chiark / gitweb /
rules_generator: fix write_cd_rules when similar names exist in the root directory
[elogind.git] / udevstart.c
index 6ea18272ea013a0788571dfa546e51c89ce7bc71..66b96a218654edffefb7e15bbdcfd719cfd6363f 100644 (file)
@@ -68,7 +68,7 @@ static int device_list_insert(const char *path, struct list_head *device_list)
        struct device *new_device;
        const char *devpath = &path[strlen(sysfs_path)];
 
-       dbg("insert: '%s'\n", devpath);
+       dbg("insert: '%s'", devpath);
 
        list_for_each_entry(loop_device, device_list, node) {
                if (strcmp(loop_device->path, devpath) > 0) {
@@ -120,7 +120,7 @@ static int add_device(const char *devpath)
        if (dev == NULL)
                return -1;
 
-       udev = udev_device_init();
+       udev = udev_device_init(NULL);
        if (udev == NULL)
                return -1;
 
@@ -148,22 +148,8 @@ static int add_device(const char *devpath)
        else
                info("device node creation supressed");
 
-       if (retval == 0 && udev_run) {
-               struct name_entry *name_loop;
-
-               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:")], udev->dev->devpath, "add");
-                       else {
-                               char program[PATH_SIZE];
-
-                               strlcpy(program, name_loop->name, sizeof(program));
-                               udev_rules_apply_format(udev, program, sizeof(program));
-                               run_program(program, udev->dev->subsystem, NULL, 0, NULL, (udev_log_priority >= LOG_INFO));
-                       }
-               }
-       }
+       if (retval == 0 && udev_run)
+               udev_rules_run(udev);
 
 exit:
        udev_device_cleanup(udev);