From bf6871639e25119cf3f8b414890d51e965ca3f97 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Tue, 2 Jun 2015 19:18:53 +0200 Subject: [PATCH] udevd: only bind ctrl and netlink sockets when we open them If they are passed from PID1 this is not necessary. --- src/udev/udevd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 1540f5c8f9..ccdec3de43 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1500,16 +1500,16 @@ static int manager_new(Manager **ret) { fd_uevent = udev_monitor_get_fd(manager->monitor); (void) udev_monitor_set_receive_buffer_size(manager->monitor, 128 * 1024 * 1024); + + r = udev_monitor_enable_receiving(manager->monitor); + if (r < 0) + return log_error_errno(EINVAL, "error binding netlink socket"); + + r = udev_ctrl_enable_receiving(manager->ctrl); + if (r < 0) + return log_error_errno(EINVAL, "error binding udev control socket"); } - r = udev_monitor_enable_receiving(manager->monitor); - if (r < 0) - return log_error_errno(EINVAL, "error binding netlink socket"); - - r = udev_ctrl_enable_receiving(manager->ctrl); - if (r < 0) - return log_error_errno(EINVAL, "error binding udev control socket"); - *ret = manager; manager = NULL;