From: Kay Sievers Date: Tue, 11 May 2010 20:59:09 +0000 (+0200) Subject: udevd: reload config only for *.rules files X-Git-Tag: 174~498 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79e1912b918eadb01cc969f7e08f6be0c47a5cbe;p=systemd udevd: reload config only for *.rules files --- diff --git a/udev/udevd.c b/udev/udevd.c index 77125437..77a14df7 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -685,14 +685,21 @@ static int handle_inotify(struct udev *udev) ev = (struct inotify_event *)(buf + pos); if (ev->len) { - dbg(udev, "inotify event: %x for %s\n", ev->mask, ev->name); + const char *s; + + info(udev, "inotify event: %x for %s\n", ev->mask, ev->name); + s = strstr(ev->name, ".rules"); + if (s == NULL) + continue; + if (strlen(s) != strlen(".rules")) + continue; reload_config = true; continue; } dev = udev_watch_lookup(udev, ev->wd); if (dev != NULL) { - dbg(udev, "inotify event: %x for %s\n", ev->mask, udev_device_get_devnode(dev)); + info(udev, "inotify event: %x for %s\n", ev->mask, udev_device_get_devnode(dev)); if (ev->mask & IN_CLOSE_WRITE) { char filename[UTIL_PATH_SIZE]; int fd;