From 3d3a0a709a38805259fe07240c3ca47a120dd5d6 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 24 Feb 2009 15:11:17 +0100 Subject: use the event udev_device to disable the watch on "remove" --- udev/udev-watch.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'udev/udev-watch.c') diff --git a/udev/udev-watch.c b/udev/udev-watch.c index a581f02cb5..dff3de1cb4 100644 --- a/udev/udev-watch.c +++ b/udev/udev-watch.c @@ -129,7 +129,7 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev) char filename[UTIL_PATH_SIZE]; int wd; - if (inotify_fd < 0 || major(udev_device_get_devnum(dev)) == 0) + if (inotify_fd < 0) return; info(udev, "adding watch on '%s'\n", udev_device_get_devnode(dev)); @@ -145,7 +145,6 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev) symlink(udev_device_get_syspath(dev), filename); udev_device_set_watch_handle(dev, wd); - udev_device_update_db(dev); } void udev_watch_end(struct udev *udev, struct udev_device *dev) @@ -153,7 +152,7 @@ void udev_watch_end(struct udev *udev, struct udev_device *dev) int wd; char filename[UTIL_PATH_SIZE]; - if (inotify_fd < 0 || major(udev_device_get_devnum(dev)) == 0) + if (inotify_fd < 0) return; wd = udev_device_get_watch_handle(dev); @@ -167,7 +166,6 @@ void udev_watch_end(struct udev *udev, struct udev_device *dev) unlink(filename); udev_device_set_watch_handle(dev, -1); - udev_device_update_db(dev); } struct udev_device *udev_watch_lookup(struct udev *udev, int wd) -- cgit v1.2.3-54-g00ecf