/* read dynamic/temporary rules */
util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/rules.d", NULL);
- if (stat(filename, &statbuf) != 0) {
- util_create_path(udev, filename);
- udev_selinux_setfscreatecon(udev, filename, S_IFDIR|0755);
- mkdir(filename, 0755);
- udev_selinux_resetfscreatecon(udev);
- }
udev_list_init(&sort_list);
add_matching_files(udev, &sort_list, filename, ".rules");
IN_CREATE | IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
} else {
char filename[UTIL_PATH_SIZE];
+ struct stat statbuf;
inotify_add_watch(pfd[FD_INOTIFY].fd, LIBEXECDIR "/rules.d",
IN_CREATE | IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
/* watch dynamic rules directory */
util_strscpyl(filename, sizeof(filename), udev_get_dev_path(udev), "/.udev/rules.d", NULL);
+ if (stat(filename, &statbuf) != 0) {
+ util_create_path(udev, filename);
+ udev_selinux_setfscreatecon(udev, filename, S_IFDIR|0755);
+ mkdir(filename, 0755);
+ udev_selinux_resetfscreatecon(udev);
+ }
inotify_add_watch(pfd[FD_INOTIFY].fd, filename,
IN_CREATE | IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
}