From c3753458fc30f35b7c2d2c5d5873198cd18131d8 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Thu, 5 Nov 2015 13:44:06 +0100 Subject: journal: fix incorrect errno reporting pread() returns -1 on error and sets errno. Do not use the -1 as errno. --- src/journal/journald-native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3-54-g00ecf