X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udevstart.c;h=66b96a218654edffefb7e15bbdcfd719cfd6363f;hp=6e1cb050c496318dfb845ef009f80223591a69ba;hb=76bd9d319e0d4376d14032cd65503da3a6c2529e;hpb=27b77df44daebbd7597c572343105c16de099233 diff --git a/udevstart.c b/udevstart.c index 6e1cb050c..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); @@ -367,6 +353,7 @@ int main(int argc, char *argv[], char *envp[]) udev_rules_cleanup(&rules); sysfs_cleanup(); + selinux_exit(); logging_close(); return 0; }