fileio: return 0 from read_one_line_file on success

Fixup for f4b51a2d09. Suggested by Evgeny Vereshchagin.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-09-24 14:27:21 +02:00
parent 2c9de13912
commit 2e33df93de

View file

@ -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) {