projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
77ba823
)
journal: fix incorrect errno reporting
author
Michal Schmidt
<mschmidt@redhat.com>
Thu, 5 Nov 2015 12:44:06 +0000
(13:44 +0100)
committer
Michal Schmidt
<mschmidt@redhat.com>
Thu, 5 Nov 2015 12:44:06 +0000
(13:44 +0100)
pread() returns -1 on error and sets errno. Do not use the -1 as errno.
src/journal/journald-native.c
patch
|
blob
|
history
diff --git
a/src/journal/journald-native.c
b/src/journal/journald-native.c
index
6fff4fe
..
b1fc875
100644
(file)
--- 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);
}