summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-09-19 16:57:57 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-09-26 11:12:04 +0200
commit5843c5ebb4341382ae9c87e93c2c87467e573548 (patch)
treef5365f245ec3b09d83336ced8b14b09483c7ed7a /src/journal
parent8097ab4f0cf7a52ac6ca45cb2b2dfe4850a2dee5 (diff)
journald: accept EPOLLERR from /dev/kmsg
Also print out unexpected epoll events explictly.
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-server.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index cc8ce0dc0d..e888480284 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1060,7 +1060,8 @@ int process_event(Server *s, struct epoll_event *ev) {
ssize_t n;
if (ev->events != EPOLLIN) {
- log_error("Got invalid event from epoll.");
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
+ "signal fd", ev->events);
return -EIO;
}
@@ -1113,8 +1114,12 @@ int process_event(Server *s, struct epoll_event *ev) {
} else if (ev->data.fd == s->dev_kmsg_fd) {
int r;
- if (ev->events != EPOLLIN) {
- log_error("Got invalid event from epoll.");
+ if (ev->events & EPOLLERR)
+ log_warning("/dev/kmsg buffer overrun, some messages lost.");
+
+ if (!(ev->events & EPOLLIN)) {
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
+ "/dev/kmsg", ev->events);
return -EIO;
}
@@ -1128,7 +1133,9 @@ int process_event(Server *s, struct epoll_event *ev) {
ev->data.fd == s->syslog_fd) {
if (ev->events != EPOLLIN) {
- log_error("Got invalid event from epoll.");
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
+ ev->data.fd == s->native_fd ? "native fd" : "syslog fd",
+ ev->events);
return -EIO;
}
@@ -1249,7 +1256,8 @@ int process_event(Server *s, struct epoll_event *ev) {
} else if (ev->data.fd == s->stdout_fd) {
if (ev->events != EPOLLIN) {
- log_error("Got invalid event from epoll.");
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
+ "stdout fd", ev->events);
return -EIO;
}
@@ -1260,6 +1268,8 @@ int process_event(Server *s, struct epoll_event *ev) {
StdoutStream *stream;
if ((ev->events|EPOLLIN|EPOLLHUP) != (EPOLLIN|EPOLLHUP)) {
+ log_error("Got invalid event from epoll for %s: %"PRIx32,
+ "stdout stream", ev->events);
log_error("Got invalid event from epoll.");
return -EIO;
}