]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device-monitor: replace -1 with -EBADF
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 31 Jul 2024 03:23:40 +0000 (12:23 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 2 Aug 2024 02:16:33 +0000 (11:16 +0900)
src/libsystemd/sd-device/device-monitor.c

index a7ef03abac262001bf16de97a3352c91ba63f1d1..5845932188e05e9721b5acdb300f76a646087527 100644 (file)
@@ -231,13 +231,13 @@ fail:
         /* Let's unset the socket fd in the monitor object before we destroy it so that the fd passed in is
          * not closed on failure. */
         if (fd >= 0)
-                m->sock = -1;
+                m->sock = -EBADF;
 
         return r;
 }
 
 _public_ int sd_device_monitor_new(sd_device_monitor **ret) {
-        return device_monitor_new_full(ret, MONITOR_GROUP_UDEV, -1);
+        return device_monitor_new_full(ret, MONITOR_GROUP_UDEV, -EBADF);
 }
 
 _public_ int sd_device_monitor_stop(sd_device_monitor *m) {