From 4aca304e48d69766d47439f0d3dcaa8797b46c78 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Wed, 11 Feb 2009 21:56:35 +0100 Subject: [PATCH] use global "reload_config" flag --- udev/udev-watch.c | 7 +------ udev/udevd.c | 7 +++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/udev/udev-watch.c b/udev/udev-watch.c index 24df481cf..92ab90785 100644 --- a/udev/udev-watch.c +++ b/udev/udev-watch.c @@ -102,21 +102,16 @@ void udev_watch_restore(struct udev *udev) buf[len] = '\0'; dbg(udev, "old watch to '%s' found\n", buf); - dev = udev_device_new_from_syspath(udev, buf); if (dev == NULL) { unlink(path); continue; } - udev_device_read_db(dev); - udev_device_set_info_loaded(dev); - info(udev, "restoring old watch on '%s'\n", udev_device_get_devnode(dev)); udev_watch_begin(udev, dev); udev_device_unref(dev); - unlink(path); } @@ -149,7 +144,7 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev) if (inotify_fd < 0) return; - wd = inotify_add_watch (inotify_fd, udev_device_get_devnode(dev), IN_CLOSE_WRITE); + wd = inotify_add_watch(inotify_fd, udev_device_get_devnode(dev), IN_CLOSE_WRITE); if (wd < 0) { err(udev, "inotify_add_watch(%d, %s, %o) failed: %m\n", inotify_fd, udev_device_get_devnode(dev), IN_CLOSE_WRITE); diff --git a/udev/udevd.c b/udev/udevd.c index d93781f41..094175ac4 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -516,7 +516,6 @@ static int handle_inotify(struct udev *udev) int nbytes, pos; char *buf; struct inotify_event *ev; - int reload_config = 0; if ((ioctl(inotify_fd, FIONREAD, &nbytes) < 0) || (nbytes <= 0)) return 0; @@ -543,7 +542,7 @@ static int handle_inotify(struct udev *udev) char filename[UTIL_PATH_SIZE]; int fd; - info(udev, "device %s closed, synthesising write\n", syspath); + info(udev, "device %s closed, synthesising 'change'\n", syspath); util_strlcpy(filename, syspath, sizeof(filename)); util_strlcat(filename, "/uevent", sizeof(filename)); fd = open(filename, O_WRONLY); @@ -559,7 +558,7 @@ static int handle_inotify(struct udev *udev) } free (buf); - return reload_config; + return 0; } static void asmlinkage sig_handler(int signum) @@ -985,7 +984,7 @@ int main(int argc, char *argv[]) /* rules directory inotify watch */ if (inotify_poll && (inotify_poll->revents & POLLIN)) - reload_config = handle_inotify(udev); + handle_inotify(udev); handle_signals: signal_received = 0; -- 2.30.2