From bf1283c1fb700a2227c815c6320f72cbca0b1850 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 31 Jul 2024 12:23:40 +0900 Subject: [PATCH] sd-device-monitor: replace -1 with -EBADF --- src/libsystemd/sd-device/device-monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index a7ef03abac2..5845932188e 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -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) { -- 2.47.3