udev: drop unnecessary call of udev_watch_end()

As it is already called by udev_event_execute_rules().
This commit is contained in:
Yu Watanabe
2022-09-12 01:36:06 +09:00
parent 2369152394
commit 4443b1857b
3 changed files with 8 additions and 14 deletions
+6 -10
View File
@@ -1151,23 +1151,19 @@ void udev_event_execute_run(UdevEvent *event, usec_t timeout_usec, int timeout_s
}
}
int udev_event_process_inotify_watch(UdevEvent *event, int inotify_fd) {
void udev_event_process_inotify_watch(UdevEvent *event, int inotify_fd) {
sd_device *dev;
assert(event);
assert(inotify_fd >= 0);
dev = event->dev;
dev = ASSERT_PTR(event->dev);
assert(dev);
if (!event->inotify_watch)
return;
if (device_for_action(dev, SD_DEVICE_REMOVE))
return 0;
return;
if (event->inotify_watch)
(void) udev_watch_begin(inotify_fd, dev);
else
(void) udev_watch_end(inotify_fd, dev);
return 0;
(void) udev_watch_begin(inotify_fd, dev);
}
+1 -1
View File
@@ -76,7 +76,7 @@ int udev_event_execute_rules(
Hashmap *properties_list,
UdevRules *rules);
void udev_event_execute_run(UdevEvent *event, usec_t timeout_usec, int timeout_signal);
int udev_event_process_inotify_watch(UdevEvent *event, int inotify_fd);
void udev_event_process_inotify_watch(UdevEvent *event, int inotify_fd);
static inline usec_t udev_warn_timeout(usec_t timeout_usec) {
return DIV_ROUND_UP(timeout_usec, 3);
+1 -3
View File
@@ -654,9 +654,7 @@ static int worker_process_device(Manager *manager, sd_device *dev) {
/* in case rtnl was initialized */
manager->rtnl = sd_netlink_ref(udev_event->rtnl);
r = udev_event_process_inotify_watch(udev_event, manager->inotify_fd);
if (r < 0)
return r;
udev_event_process_inotify_watch(udev_event, manager->inotify_fd);
log_device_uevent(dev, "Device processed");
return 0;