From: Zbigniew Jędrzejewski-Szmek Date: Thu, 16 Jul 2020 14:12:42 +0000 (+0200) Subject: udev: don't complain when udev_watch_end() is called without udev_watch_init() X-Git-Tag: v246-rc2~53^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6d4961b01a986984f018bae141eabbce83f0e20;p=thirdparty%2Fsystemd.git 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). --- diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c index 68b51d04a35..96a25ddf7cf 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)