]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-file: always generate the same error when encountering corrupted files
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Apr 2016 09:37:22 +0000 (11:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 26 Apr 2016 10:00:03 +0000 (12:00 +0200)
Let's make sure EBADMSG is the one error we throw when we encounter corrupted
data, so that we can neatly test for it.

src/journal/journal-file.c

index c4318636f71f7477509f87b1ed0d0a1a28b81b4b..e13ae05990b8589bd3e02c0f2e7f322f73e8263b 100644 (file)
@@ -707,7 +707,7 @@ int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
 
         /* Objects may only be located at multiple of 64 bit */
         if (!VALID64(offset))
-                return -EFAULT;
+                return -EBADMSG;
 
         /* Object may not be located in the file header */
         if (offset < le64toh(f->header->header_size))