1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 16:21:26 +03:00

udev: explicitly mention that the error will be ignored

See #19788.
This commit is contained in:
Yu Watanabe 2021-06-02 19:14:12 +09:00
parent 6be1feb1d7
commit d46969072a

View File

@ -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);