diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-03-11 11:41:52 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-04-30 12:32:14 +0200 |
commit | 5e0d05106747d2ee25ce19a51ed8a5669ea93bf9 (patch) | |
tree | 6bc1e7f25171d87b10abd64bcd191e04dba5f7cf /src/udev/udev-watch.c | |
parent | sd-device: cleanup sd_device_get_subsystem() (diff) | |
download | systemd-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.c | 3 |
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; |