From d46969072aee230bf231ea8aa2eae9f7d61a1e7a Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 2 Jun 2021 19:14:12 +0900 Subject: udev: explicitly mention that the error will be ignored See #19788. --- src/udev/udev-watch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/udev/udev-watch.c') diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c index 7f15c87870..6032dfb4f6 100644 --- a/src/udev/udev-watch.c +++ b/src/udev/udev-watch.c @@ -83,11 +83,14 @@ int udev_watch_begin(int inotify_fd, sd_device *dev) { log_device_debug(dev, "Adding watch on '%s'", devnode); wd = inotify_add_watch(inotify_fd, devnode, IN_CLOSE_WRITE); if (wd < 0) { - r = log_device_full_errno(dev, errno == ENOENT ? LOG_DEBUG : LOG_WARNING, - errno, "Failed to add device '%s' to watch: %m", devnode); + bool ignore = errno == ENOENT; + + r = log_device_full_errno(dev, ignore ? LOG_DEBUG : LOG_WARNING, errno, + "Failed to add device '%s' to watch%s: %m", + devnode, ignore ? ", ignoring" : ""); (void) device_set_watch_handle(dev, -1); - return r; + return ignore ? 0 : r; } r = device_set_watch_handle(dev, wd); -- cgit v1.2.1