diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-06-04 02:49:42 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-06-04 02:49:42 +0200 |
commit | 9290143d2d8ee9e42459d198b87ad2c35d93819d (patch) | |
tree | 22123b5b0cbc5c3f1659eba0a9526999a240c8a9 | |
parent | 1e03b754aef576a5cb75f01b1805cdc1f9cc292f (diff) |
udevd: close netlink socket in worker and set cloexec
-rw-r--r-- | udev/udevd.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/udev/udevd.c b/udev/udevd.c index c0852022e2..2e7a179cbc 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -195,6 +195,7 @@ static void worker_new(struct event *event) /* allow the main daemon netlink address to send devices to the worker */ udev_monitor_allow_unicast_sender(worker_monitor, monitor); udev_monitor_enable_receiving(worker_monitor); + util_set_fd_cloexec(udev_monitor_get_fd(worker_monitor)); worker = calloc(1, sizeof(struct worker)); if (worker == NULL) @@ -207,6 +208,7 @@ static void worker_new(struct event *event) struct udev_device *dev; udev_queue_export_unref(udev_queue_export); + udev_monitor_unref(monitor); udev_ctrl_unref(udev_ctrl); close(pfd[FD_SIGNAL].fd); close(worker_watch[READ_END]); @@ -885,6 +887,7 @@ int main(int argc, char *argv[]) goto exit; } pfd[FD_WORKER].fd = worker_watch[READ_END]; + util_set_fd_cloexec(worker_watch[WRITE_END]); rules = udev_rules_new(udev, resolve_names); if (rules == NULL) { |