]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: do not call device_monitor_enable_receiving() for passed fd from pid1
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Nov 2018 05:52:24 +0000 (14:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 25 Nov 2018 11:14:17 +0000 (20:14 +0900)
Before c4b69e990f962128cc6975e36e91e9ad838fa2c4, if the socket fd is
passed from pid1, `udev_monitor_enable_receiving()` (now it is a wrapper
of `device_monitor_enable_receiving`) was not called.
Let's preserve the original logic.

Fixes #10754.

src/libsystemd/sd-device/device-monitor.c

index ff0fdbc93e3928b6c57735c6e79f2471df641f4a..8f2eec1bda7c8cc85bd9c660808c61fc9f571b48 100644 (file)
@@ -210,9 +210,11 @@ _public_ int sd_device_monitor_start(sd_device_monitor *m, sd_device_monitor_han
                         return r;
         }
 
-        r = device_monitor_enable_receiving(m);
-        if (r < 0)
-                return r;
+        if (!m->bound) {
+                r = device_monitor_enable_receiving(m);
+                if (r < 0)
+                        return r;
+        }
 
         m->callback = callback;
         m->userdata = userdata;