chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fsckd: make sure we free the connection event source before we close the connection fd
[elogind.git]
/
src
/
fsckd
/
fsckd.c
diff --git
a/src/fsckd/fsckd.c
b/src/fsckd/fsckd.c
index 4851b9275889f0981aa59cefa44d889e244b13a1..1415b53dd487f9302ed55f409392d85aca7c458c 100644
(file)
--- a/
src/fsckd/fsckd.c
+++ b/
src/fsckd/fsckd.c
@@
-77,7
+77,9
@@
typedef struct Manager {
unsigned n_clients;
int clear;
unsigned n_clients;
int clear;
+
int connection_fd;
int connection_fd;
+ sd_event_source *connection_event_source;
FILE *console;
double percent;
FILE *console;
double percent;
@@
-444,6
+446,7
@@
static void manager_free(Manager *m) {
fflush(m->console);
}
fflush(m->console);
}
+ sd_event_source_unref(m->connection_event_source);
safe_close(m->connection_fd);
while (m->clients)
safe_close(m->connection_fd);
while (m->clients)
@@
-483,7
+486,7
@@
static int manager_new(Manager **ret, int fd) {
return -errno;
}
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;
if (r < 0)
return r;