udev: drop unnecessary call of udev_watch_end()
As it is already called by udev_event_execute_rules().
This commit is contained in:
+6
-10
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user