]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevd: do not set buffer size if the socket is passed from pid1
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Nov 2018 06:04:26 +0000 (15:04 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Nov 2018 11:17:25 +0000 (20:17 +0900)
Before c4b69e990f962128cc6975e36e91e9ad838fa2c4, if the socket fd is
passed from pid1, `udev_monitor_set_receive_buffer_size()` (now it is
a wrapper of `sd_device_monitor_set_receive_buffer_size()`) was not
called. Let's preserve the original logic.

src/udev/udevd.c

index 6eacfe811f6e817c9ba78c9537aeaff496985a9d..aeec7fa77c58ac20af5b9379afec3d4eb027a2de 100644 (file)
@@ -1629,7 +1629,8 @@ static int manager_new(Manager **ret, int fd_ctrl, int fd_uevent, const char *cg
         if (r < 0)
                 return log_error_errno(r, "Failed to initialize device monitor: %m");
 
-        (void) sd_device_monitor_set_receive_buffer_size(manager->monitor, 128 * 1024 * 1024);
+        if (fd_uevent < 0)
+                (void) sd_device_monitor_set_receive_buffer_size(manager->monitor, 128 * 1024 * 1024);
 
         /* unnamed socket from workers to the main daemon */
         r = socketpair(AF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC, 0, manager->worker_watch);