X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=namedev.c;h=f3fb3ff7edac049083ff884e8db9b6fb371423aa;hb=0bac7bab72648fe9f2667287b38d371929341b4f;hp=39f033726c5cdc554e0a641aee77b5845f259c96;hpb=707680b1cf08369da365de1a5e06089621ff8c77;p=elogind.git diff --git a/namedev.c b/namedev.c index 39f033726..f3fb3ff7e 100644 --- a/namedev.c +++ b/namedev.c @@ -40,7 +40,6 @@ #include "udev_version.h" #include "logging.h" #include "namedev.h" -#include "klibc_fixups.h" #include "udevdb.h" static struct sysfs_attribute *find_sysfs_attribute(struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device, char *attr); @@ -445,7 +444,7 @@ static int execute_program(const char *path, char *value, int len) dbg("result is '%s'", value); close(fds[0]); - wait(&status); + waitpid(pid, &status, 0); if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) { dbg("exec program status 0x%x", status); @@ -692,7 +691,7 @@ try_parent: } -int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *udev) +int namedev_name_device(struct udevice *udev, struct sysfs_class_device *class_dev) { struct sysfs_class_device *class_dev_parent; struct sysfs_device *sysfs_device = NULL; @@ -718,9 +717,10 @@ int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *ud } if (sysfs_device) { - dbg("found /device-device: path='%s', bus_id='%s', bus='%s'", + dbg("found devices device: path='%s', bus_id='%s', bus='%s'", sysfs_device->path, sysfs_device->bus_id, sysfs_device->bus); strfieldcpy(udev->bus_id, sysfs_device->bus_id); + strfieldcpy(udev->bus, sysfs_device->bus); } strfieldcpy(udev->kernel_name, class_dev->name); @@ -798,11 +798,10 @@ perms: set_empty_perms(udev, perm->mode, perm->owner, perm->group); - } else { - set_empty_perms(udev, get_default_mode(), - get_default_owner(), - get_default_group()); } + set_empty_perms(udev, get_default_mode(), + get_default_owner(), + get_default_group()); dbg("name, '%s' is going to have owner='%s', group='%s', mode = %#o", udev->name, udev->owner, udev->group, udev->mode);