diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-12-17 20:02:21 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-12-17 20:02:21 +0100 |
commit | a69f4254a82765cd0c7f155d5dc86e0768ea0ef3 (patch) | |
tree | 838833da24262431b0a23500486050bc72914441 /src/journal/journald-kmsg.c | |
parent | c0f71f469fef3f3a0822e0021085e6d165df2b46 (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.c | 9 |
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; } |