summaryrefslogtreecommitdiff
path: root/src/journal/journald-native.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-native.c
parent419173e60a05424008fcd312f6df4b59b2ce8e62 (diff)
journald: port to sd-event and enable watchdog support
Diffstat (limited to 'src/journal/journald-native.c')
-rw-r--r--src/journal/journald-native.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index 2c91cba16d..5e19fa3f55 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -369,7 +369,6 @@ void server_process_native_file(
int server_open_native_socket(Server*s) {
union sockaddr_union sa;
int one, r;
- struct epoll_event ev;
assert(s);
@@ -420,12 +419,10 @@ int server_open_native_socket(Server*s) {
return -errno;
}
- zero(ev);
- ev.events = EPOLLIN;
- ev.data.fd = s->native_fd;
- if (epoll_ctl(s->epoll_fd, EPOLL_CTL_ADD, s->native_fd, &ev) < 0) {
- log_error("Failed to add native server fd to epoll object: %m");
- return -errno;
+ r = sd_event_add_io(s->event, s->native_fd, EPOLLIN, process_datagram, s, &s->native_event_source);
+ if (r < 0) {
+ log_error("Failed to add native server fd to event loop: %s", strerror(-r));
+ return r;
}
return 0;