summaryrefslogtreecommitdiff
path: root/src/journal/journald.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-03 12:23:33 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-03 12:23:33 +0200
commit4c2ecfafd746411b07b8de10b91f5fd26fdd9cb3 (patch)
tree45f88578517c0887446588534d75cd22f1b13272 /src/journal/journald.c
parente590af2666d2a958d355f9957e77ec967bb16011 (diff)
journald: handle /proc/kmsg reads returning 0 more nicely
Diffstat (limited to 'src/journal/journald.c')
-rw-r--r--src/journal/journald.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/journal/journald.c b/src/journal/journald.c
index 08597ae3eb..d2e2fcacac 100644
--- 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)