From a69f4254a82765cd0c7f155d5dc86e0768ea0ef3 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 17 Dec 2013 20:02:21 +0100 Subject: journald: before closing /dev/kmsg let's unregister the event source --- src/journal/journald-kmsg.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c index 5c7c06a14a..0c8446a3d5 100644 --- a/src/journal/journald-kmsg.c +++ b/src/journal/journald-kmsg.c @@ -428,8 +428,13 @@ int server_open_dev_kmsg(Server *s) { return 0; fail: - close_nointr_nofail(s->dev_kmsg_fd); - s->dev_kmsg_fd = -1; + if (s->dev_kmsg_event_source) + s->dev_kmsg_event_source = sd_event_source_unref(s->dev_kmsg_event_source); + + if (s->dev_kmsg_fd >= 0) { + close_nointr_nofail(s->dev_kmsg_fd); + s->dev_kmsg_fd = -1; + } return r; } -- cgit v1.2.3-54-g00ecf