X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=namedev.c;h=9cfc4283be12b8b4d57df85695ea308d1b1c2818;hb=82ca88904d1c9bf17f4434f54e12754c00eddcbd;hp=0bc28bd028cc4eee3822b6540946986004364b2f;hpb=5f72c470ad244020f65784c33eb6bcd4ae149403;p=elogind.git diff --git a/namedev.c b/namedev.c index 0bc28bd02..9cfc4283b 100644 --- a/namedev.c +++ b/namedev.c @@ -31,7 +31,6 @@ #include #include #include -#include #include "libsysfs/sysfs/libsysfs.h" #include "list.h" @@ -666,8 +665,7 @@ static int match_rule(struct udevice *udev, struct config_device *dev, /* check for matching result of external program */ if (dev->result[0] != '\0') { - dbg("check for " FIELD_RESULT - " dev->result='%s', udev->program_result='%s'", + dbg("check for " FIELD_RESULT " dev->result='%s', udev->program_result='%s'", dev->result, udev->program_result); if (strcmp_pattern(dev->result, udev->program_result) != 0) { dbg(FIELD_RESULT " is not matching"); @@ -697,7 +695,6 @@ int namedev_name_device(struct udevice *udev, struct sysfs_class_device *class_d struct sysfs_device *sysfs_device = NULL; struct config_device *dev; struct perm_device *perm; - struct sysinfo info; char *pos; udev->mode = 0; @@ -774,12 +771,14 @@ int namedev_name_device(struct udevice *udev, struct sysfs_class_device *class_d udev->ignore_remove = dev->ignore_remove; if (udev->type == 'n') - goto done; + goto exit; udev->partitions = dev->partitions; udev->mode = dev->mode; strfieldcpy(udev->owner, dev->owner); + apply_format(udev, udev->owner, sizeof(udev->owner), class_dev, sysfs_device); strfieldcpy(udev->group, dev->group); + apply_format(udev, udev->group, sizeof(udev->group), class_dev, sysfs_device); goto perms; } @@ -790,7 +789,7 @@ int namedev_name_device(struct udevice *udev, struct sysfs_class_device *class_d strfieldcpy(udev->name, udev->kernel_name); if (udev->type == 'n') - goto done; + goto exit; perms: /* apply permissions from permissions file to empty fields */ @@ -815,11 +814,7 @@ perms: dbg("name, '%s' is going to have owner='%s', group='%s', mode = %#o", udev->name, udev->owner, udev->group, udev->mode); -done: - /* store time of action */ - sysinfo(&info); - udev->config_uptime = info.uptime; - +exit: return 0; }