summaryrefslogtreecommitdiff
path: root/udev/udevd.c
diff options
context:
space:
mode:
authorScott James Remnant <scott@ubuntu.com>2009-02-23 17:21:24 +0000
committerScott James Remnant <scott@ubuntu.com>2009-02-23 17:21:24 +0000
commit03e0170db3ef69c70db7cd74e6689c7b78c91c3d (patch)
tree6fa723b6487e209993edcd5cb43d8e00dd94dfdd /udev/udevd.c
parent521b3a9211b4e2d98bf7ae61c3844a42dde773e2 (diff)
Cleanup a little.
Move some of the checks into udev_watch_begin() and udev_watch_clear() so we don't have to repeat them all the time.
Diffstat (limited to 'udev/udevd.c')
-rw-r--r--udev/udevd.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/udev/udevd.c b/udev/udevd.c
index 50205f1e43..27e64dae3a 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -216,9 +216,7 @@ static void event_fork(struct udev_event *event)
alarm(UDEV_EVENT_TIMEOUT);
/* clear any existing udev watch on the node */
- if (inotify_fd != -1 &&
- major(udev_device_get_devnum(event->dev)) != 0)
- udev_watch_clear(event->udev, event->dev);
+ udev_watch_clear(event->udev, event->dev);
/* apply rules, create node, symlinks */
err = udev_event_execute_rules(event, rules);
@@ -232,8 +230,7 @@ static void event_fork(struct udev_event *event)
udev_event_execute_run(event);
/* apply/restore inotify watch */
- if (err == 0 && event->inotify_watch && inotify_fd != -1 &&
- major(udev_device_get_devnum(event->dev)) != 0 &&
+ if (err == 0 && event->inotify_watch &&
strcmp(udev_device_get_action(event->dev), "remove") != 0)
info(event->udev, "device will be watched for changes\n");
udev_watch_begin(event->udev, event->dev);