diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-03-09 19:41:01 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-03-09 19:41:01 +0100 |
commit | 57b394b50579feeee90a4cb12243d5785a9176a6 (patch) | |
tree | 9adfc3aa617616df943a140e938151f55e1f7d24 | |
parent | e78e0674f3ec8512370110383889848dc662639b (diff) |
fsckd: make sure we free the connection event source before we close the connection fd
-rw-r--r-- | src/fsckd/fsckd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fsckd/fsckd.c b/src/fsckd/fsckd.c index 4851b92758..1415b53dd4 100644 --- a/src/fsckd/fsckd.c +++ b/src/fsckd/fsckd.c @@ -77,7 +77,9 @@ typedef struct Manager { unsigned n_clients; int clear; + int connection_fd; + sd_event_source *connection_event_source; FILE *console; double percent; @@ -444,6 +446,7 @@ static void manager_free(Manager *m) { fflush(m->console); } + sd_event_source_unref(m->connection_event_source); safe_close(m->connection_fd); while (m->clients) @@ -483,7 +486,7 @@ static int manager_new(Manager **ret, int fd) { return -errno; } - r = sd_event_add_io(m->event, NULL, fd, EPOLLIN, manager_new_connection_handler, m); + r = sd_event_add_io(m->event, &m->connection_event_source, fd, EPOLLIN, manager_new_connection_handler, m); if (r < 0) return r; |