chiark / gitweb /
[PATCH] move distro specific config files into their own directories
[elogind.git] / namedev.c
index 0bc28bd028cc4eee3822b6540946986004364b2f..9cfc4283be12b8b4d57df85695ea308d1b1c2818 100644 (file)
--- a/namedev.c
+++ b/namedev.c
@@ -31,7 +31,6 @@
 #include <errno.h>
 #include <sys/wait.h>
 #include <sys/stat.h>
-#include <sys/sysinfo.h>
 
 #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;
 }