From: Zbigniew Jędrzejewski-Szmek Date: Sun, 25 Oct 2015 04:09:44 +0000 (-0400) Subject: journal: return better error for empty files X-Git-Tag: v228~108^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cfb571f30fd415304b2f674f1615dc861058c347;p=thirdparty%2Fsystemd.git journal: return better error for empty files When reading stuff, we should only return EIO when an actual read error occured, not when we don't like the data for whatever reason. We already return ENODATA for all other kinds of file truncation, hence do the same for the most obvious kind, so that callers know what ENODATA means. --- diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 12b39dbb278..e00a0d711d8 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -2705,7 +2705,7 @@ int journal_file_open( } if (f->last_stat.st_size < (off_t) HEADER_SIZE_MIN) { - r = -EIO; + r = -ENODATA; goto fail; }