diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-09-24 14:27:21 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-09-24 14:27:21 +0200 |
commit | 2e33df93dee35af986683d1226f93e0f9659de5d (patch) | |
tree | 6866b5fcfc0e7392855a691724900cba9ae70fb3 /src/basic/fileio.c | |
parent | 2c9de13912350f5887ccccdae9e1707512208053 (diff) | |
download | systemd-2e33df93dee35af986683d1226f93e0f9659de5d.tar.gz systemd-2e33df93dee35af986683d1226f93e0f9659de5d.tar.bz2 systemd-2e33df93dee35af986683d1226f93e0f9659de5d.zip |
fileio: return 0 from read_one_line_file on success
Fixup for f4b51a2d09. Suggested by Evgeny Vereshchagin.
Diffstat (limited to 'src/basic/fileio.c')
-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) { |