summaryrefslogtreecommitdiff
path: root/src/journal/journald-kmsg.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-17 20:02:21 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-17 20:02:21 +0100
commita69f4254a82765cd0c7f155d5dc86e0768ea0ef3 (patch)
tree838833da24262431b0a23500486050bc72914441 /src/journal/journald-kmsg.c
parentc0f71f469fef3f3a0822e0021085e6d165df2b46 (diff)
journald: before closing /dev/kmsg let's unregister the event source
Diffstat (limited to 'src/journal/journald-kmsg.c')
-rw-r--r--src/journal/journald-kmsg.c9
1 files 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;
}