summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-watch.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-03-11 11:41:52 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-04-30 12:32:14 +0200
commit5e0d05106747d2ee25ce19a51ed8a5669ea93bf9 (patch)
tree6bc1e7f25171d87b10abd64bcd191e04dba5f7cf /src/udev/udev-watch.c
parentsd-device: cleanup sd_device_get_subsystem() (diff)
downloadsystemd-5e0d05106747d2ee25ce19a51ed8a5669ea93bf9.tar.xz
systemd-5e0d05106747d2ee25ce19a51ed8a5669ea93bf9.zip
udev: make udev_watch_end() noop when device does not have devname
Diffstat (limited to 'src/udev/udev-watch.c')
-rw-r--r--src/udev/udev-watch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c
index dca843e3f1..f5085107be 100644
--- a/src/udev/udev-watch.c
+++ b/src/udev/udev-watch.c
@@ -112,6 +112,9 @@ int udev_watch_end(int inotify_fd, sd_device *dev) {
if (inotify_fd < 0)
return 0;
+ if (sd_device_get_devname(dev, NULL) < 0)
+ return 0;
+
r = device_get_watch_handle(dev, &wd);
if (r == -ENOENT)
return 0;