X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udevstart.c;h=66b96a218654edffefb7e15bbdcfd719cfd6363f;hp=6ea18272ea013a0788571dfa546e51c89ce7bc71;hb=0837c28e9b3bc1fc42ed0d4212abdddd3277e1fa;hpb=456cb387567da8a2beadf003dcbd874022dbc873 diff --git a/udevstart.c b/udevstart.c index 6ea18272e..66b96a218 100644 --- a/udevstart.c +++ b/udevstart.c @@ -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);