summaryrefslogtreecommitdiff
path: root/src/journal/journald-syslog.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-11 20:13:44 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-11 20:55:09 +0100
commitf9a810bedacf1da7c505c1786a2416d592665926 (patch)
treee4fdb88684e2bacb4567228aabd3448d75fb3ce0 /src/journal/journald-syslog.c
parent419173e60a05424008fcd312f6df4b59b2ce8e62 (diff)
journald: port to sd-event and enable watchdog support
Diffstat (limited to 'src/journal/journald-syslog.c')
-rw-r--r--src/journal/journald-syslog.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
index 2caa1738d9..80eb9ff2db 100644
--- a/src/journal/journald-syslog.c
+++ b/src/journal/journald-syslog.c
@@ -418,7 +418,6 @@ void server_process_syslog_message(
int server_open_syslog_socket(Server *s) {
int one, r;
- struct epoll_event ev;
assert(s);
@@ -469,12 +468,10 @@ int server_open_syslog_socket(Server *s) {
return -errno;
}
- zero(ev);
- ev.events = EPOLLIN;
- ev.data.fd = s->syslog_fd;
- if (epoll_ctl(s->epoll_fd, EPOLL_CTL_ADD, s->syslog_fd, &ev) < 0) {
- log_error("Failed to add syslog server fd to epoll object: %m");
- return -errno;
+ r = sd_event_add_io(s->event, s->syslog_fd, EPOLLIN, process_datagram, s, &s->syslog_event_source);
+ if (r < 0) {
+ log_error("Failed to add syslog server fd to event loop: %s", strerror(-r));
+ return r;
}
return 0;