summaryrefslogtreecommitdiff
path: root/src/udev/udev-watch.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-03-11 19:41:52 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-04-30 19:32:14 +0900
commit5e0d05106747d2ee25ce19a51ed8a5669ea93bf9 (patch)
tree6bc1e7f25171d87b10abd64bcd191e04dba5f7cf /src/udev/udev-watch.c
parent4956f220a12ba9c00dcdfdc2273e98b71ff33bae (diff)
downloadsystemd-5e0d05106747d2ee25ce19a51ed8a5669ea93bf9.tar.gz
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;