diff options
author | Ian Stakenvicius <axs@gentoo.org> | 2013-01-24 14:11:04 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2013-04-04 10:28:09 -0400 |
commit | 85c2dfdb18fb80cf9d5e38c1119ba7e7df135ee1 (patch) | |
tree | 5134c1127d9f04e6527f7e0eb47f766fe57d6a2c /src | |
parent | d71bb748b299983bf7dc90bf0281083b289c8c6f (diff) |
Initial forward-port of rules.d inotify support
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/udev/udevd.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 0034fa344e..da23a0d917 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1137,6 +1137,18 @@ int main(int argc, char *argv[]) rc = 4; goto exit; } + /* watch rules.d paths for changes */ + inotify_add_watch(fd_inotify, UDEV_RULES_DIR, + IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); + inotify_add_watch(fd_inotify, UDEV_CONF_DIR "/rules.d", + IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); + + if (access("/run/udev/rules.d", F_OK) < 0) { + mkdir_p("/run/udev/rules.d", 0755); + } + inotify_add_watch(fd_inotify, "/run/udev/rules.d", + IN_DELETE | IN_MOVE | IN_CLOSE_WRITE); + udev_watch_restore(udev); /* block and listen to all signals on signalfd */ |