chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e590af2
)
journald: handle /proc/kmsg reads returning 0 more nicely
author
Lennart Poettering
<lennart@poettering.net>
Tue, 3 Jul 2012 10:23:33 +0000
(12:23 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 3 Jul 2012 10:23:33 +0000
(12:23 +0200)
src/journal/journald.c
patch
|
blob
|
history
diff --git
a/src/journal/journald.c
b/src/journal/journald.c
index 08597ae3eb9630dc22b43151d7163336465a0ead..d2e2fcacac25b6480d8dc6bd6cc06037108c6425 100644
(file)
--- a/
src/journal/journald.c
+++ b/
src/journal/journald.c
@@
-2148,6
+2148,10
@@
static int server_read_proc_kmsg(Server *s) {
assert(s->proc_kmsg_fd >= 0);
l = read(s->proc_kmsg_fd, s->proc_kmsg_buffer + s->proc_kmsg_length, sizeof(s->proc_kmsg_buffer) - 1 - s->proc_kmsg_length);
+ if (l == 0) /* the kernel is stupid and in some race
+ * conditions returns 0 in the middle of the
+ * stream. */
+ return 0;
if (l < 0) {
if (errno == EAGAIN || errno == EINTR)