chiark / gitweb /
core: when we close the notify fd, we also need to free its event source
authorLennart Poettering <lennart@poettering.net>
Mon, 23 Dec 2013 20:01:32 +0000 (21:01 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 23 Dec 2013 20:01:32 +0000 (21:01 +0100)
src/core/manager.c

index d8d5667..c26dcaa 100644 (file)
@@ -2208,8 +2208,10 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
                         if (safe_atoi(l + 10, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd))
                                 log_debug("Failed to parse notify fd: %s", l + 10);
                         else {
-                                if (m->notify_fd >= 0)
+                                if (m->notify_fd >= 0) {
+                                        m->notify_event_source = sd_event_source_unref(m->notify_event_source);
                                         close_nointr_nofail(m->notify_fd);
+                                }
 
                                 m->notify_fd = fdset_remove(fds, fd);
                         }