chiark / gitweb /
persistent rules: fix typo in dm rule
[elogind.git] / udevd.c
diff --git a/udevd.c b/udevd.c
index 8741a0901b1752e6088c5887c97f0dbd6bf9ea28..b0c38eb41347ada9e082e51b8c25f2f7a801c2ef 100644 (file)
--- a/udevd.c
+++ b/udevd.c
@@ -130,7 +130,7 @@ static int udev_event_process(struct uevent_msg *msg)
                dbg("executing run list");
                list_for_each_entry(name_loop, &udev->run_list, node) {
                        if (strncmp(name_loop->name, "socket:", strlen("socket:")) == 0)
-                               pass_env_to_socket(&name_loop->name[strlen("socket:")], msg->devpath, msg->action);
+                               pass_env_to_socket(&name_loop->name[strlen("socket:")], udev->dev->devpath, udev->action);
                        else {
                                char program[PATH_SIZE];
 
@@ -971,8 +971,12 @@ int main(int argc, char *argv[], char *envp[])
 
        /* watch rules directory */
        inotify_fd = inotify_init();
-       if (inotify_fd > 0)
+       if (inotify_fd >= 0)
                inotify_add_watch(inotify_fd, udev_rules_filename, IN_CREATE | IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
+       else if (errno == ENOSYS)
+               err("the kernel does not support inotify, udevd can't monitor configuration file changes");
+       else
+               err("inotify_init failed: %s", strerror(errno));
 
        /* maximum limit of forked childs */
        value = getenv("UDEVD_MAX_CHILDS");