diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-10-25 00:09:44 -0400 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-11-03 00:02:00 +0100 |
commit | cfb571f30fd415304b2f674f1615dc861058c347 (patch) | |
tree | d85eab08cb284b51708ae1a81e6ca192a4d869c6 | |
parent | d8e023aa07029b672fba425e100330ef6343e22d (diff) |
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.
-rw-r--r-- | src/journal/journal-file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 12b39dbb27..e00a0d711d 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; } |