summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-11-05 13:44:06 +0100
committerMichal Schmidt <mschmidt@redhat.com>2015-11-05 13:44:06 +0100
commitc3753458fc30f35b7c2d2c5d5873198cd18131d8 (patch)
treed3edc8bd9489567ea3782b23f4587efaea409463
parent77ba8233f70719ddd53373f98c53c5cfd5ff13c7 (diff)
journal: fix incorrect errno reporting
pread() returns -1 on error and sets errno. Do not use the -1 as errno.
-rw-r--r--src/journal/journald-native.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index 6fff4fe473..b1fc875596 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -413,7 +413,7 @@ void server_process_native_file(
n = pread(fd, p, st.st_size, 0);
if (n < 0)
- log_error_errno(n, "Failed to read file, ignoring: %m");
+ log_error_errno(errno, "Failed to read file, ignoring: %m");
else if (n > 0)
server_process_native_message(s, p, n, ucred, tv, label, label_len);
}