summaryrefslogtreecommitdiff
path: root/src/udev/udev-watch.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-07-16 16:12:42 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-07-16 18:38:03 +0200
commitd6d4961b01a986984f018bae141eabbce83f0e20 (patch)
treebd3edb462c98cd8706dccae48ede9730f3653b12 /src/udev/udev-watch.c
parent6b9f5f01cb0f507218402e96da4d05e7a5fa31db (diff)
downloadsystemd-d6d4961b01a986984f018bae141eabbce83f0e20.tar.gz
udev: don't complain when udev_watch_end() is called without udev_watch_init()
E.g. udevadm test prints "Invalid inotify descriptor." which is meaningless without any context. I think it should be OK to call udev_watch_end() from a cleanup path without any warning (even at debug level).
Diffstat (limited to 'src/udev/udev-watch.c')
-rw-r--r--src/udev/udev-watch.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c
index 68b51d04a3..96a25ddf7c 100644
--- a/src/udev/udev-watch.c
+++ b/src/udev/udev-watch.c
@@ -125,8 +125,7 @@ int udev_watch_end(sd_device *dev) {
int wd, r;
if (inotify_fd < 0)
- return log_debug_errno(SYNTHETIC_ERRNO(EINVAL),
- "Invalid inotify descriptor.");
+ return 0; /* Nothing to do. */
r = device_get_watch_handle(dev, &wd);
if (r == -ENOENT)