summaryrefslogtreecommitdiffstats
path: root/src/udev/udevd.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-05-24 15:10:04 +0200
committerTom Gundersen <teg@jklm.no>2015-05-24 15:29:48 +0200
commit6d1b1e0bc6bd020218afc5f05286bf372be283d5 (patch)
tree7610f883a723248f86c2f6979fc58b5176a9cf68 /src/udev/udevd.c
parentbootctl: fix an error check (diff)
downloadsystemd-6d1b1e0bc6bd020218afc5f05286bf372be283d5.tar.xz
systemd-6d1b1e0bc6bd020218afc5f05286bf372be283d5.zip
udevd: worker - fully clean up unnecessary fds
These are only ever used in the parent process, so close them early in the worker.
Diffstat (limited to 'src/udev/udevd.c')
-rw-r--r--src/udev/udevd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index afd4640ad1..d8cb046e13 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -329,11 +329,15 @@ static void worker_spawn(Manager *manager, struct event *event) {
manager_workers_free(manager);
event_queue_cleanup(manager, EVENT_UNDEF);
+
manager->monitor = udev_monitor_unref(manager->monitor);
+ manager->ctrl_conn_blocking = udev_ctrl_connection_unref(manager->ctrl_conn_blocking);
manager->ctrl = udev_ctrl_unref(manager->ctrl);
+
+ manager->fd_ep = safe_close(manager->fd_ep);
manager->fd_signal = safe_close(manager->fd_signal);
+ manager->fd_inotify = safe_close(manager->fd_inotify);
manager->worker_watch[READ_END] = safe_close(manager->worker_watch[READ_END]);
- manager->fd_ep = safe_close(manager->fd_ep);
sigfillset(&mask);
fd_signal = signalfd(-1, &mask, SFD_NONBLOCK|SFD_CLOEXEC);