diff options
-rw-r--r-- | src/basic/fileio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/basic/fileio.c b/src/basic/fileio.c index ae5536a635..d632a6e714 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -178,6 +178,7 @@ fail: int read_one_line_file(const char *fn, char **line) { _cleanup_fclose_ FILE *f = NULL; + int r; assert(fn); assert(line); @@ -186,7 +187,8 @@ int read_one_line_file(const char *fn, char **line) { if (!f) return -errno; - return read_line(f, LONG_LINE_MAX, line); + r = read_line(f, LONG_LINE_MAX, line); + return r < 0 ? r : 0; } int verify_file(const char *fn, const char *blob, bool accept_extra_nl) { |