chiark / gitweb /
[PATCH] add ENV{} key to match agains environment variables
[elogind.git] / udev_utils.c
index d572581f656b1f4822dc89fc81289a984a298c33..c6658e6933fbcc0a795d26c3dcbf71044aabf19a 100644 (file)
@@ -53,13 +53,13 @@ int udev_init_device(struct udevice *udev, const char* devpath, const char *subs
                no_trailing_slash(udev->devpath);
 
                if (strncmp(udev->devpath, "/block/", 7) == 0)
-                       udev->type = BLOCK;
+                       udev->type = DEV_BLOCK;
                else if (strncmp(udev->devpath, "/class/net/", 11) == 0)
-                       udev->type = NET;
+                       udev->type = DEV_NET;
                else if (strncmp(udev->devpath, "/class/", 7) == 0)
-                       udev->type = CLASS;
+                       udev->type = DEV_CLASS;
                else if (strncmp(udev->devpath, "/devices/", 9) == 0)
-                       udev->type = PHYSDEV;
+                       udev->type = DEV_DEVICE;
 
                /* get kernel name */
                pos = strrchr(udev->devpath, '/');
@@ -85,8 +85,8 @@ int udev_init_device(struct udevice *udev, const char* devpath, const char *subs
        }
 
        udev->mode = 0660;
-       strcpy(udev->owner, "0");
-       strcpy(udev->group, "0");
+       strcpy(udev->owner, "root");
+       strcpy(udev->group, "root");
 
        return 0;
 }
@@ -177,41 +177,6 @@ int unlink_secure(const char *filename)
        return retval;
 }
 
-int parse_get_pair(char **orig_string, char **left, char **right)
-{
-       char *temp;
-       char *string = *orig_string;
-
-       if (!string)
-               return -ENODEV;
-
-       /* eat any whitespace */
-       while (isspace(*string) || *string == ',')
-               ++string;
-
-       /* split based on '=' */
-       temp = strsep(&string, "=");
-       *left = temp;
-       if (!string)
-               return -ENODEV;
-
-       /* take the right side and strip off the '"' */
-       while (isspace(string[0]))
-               ++string;
-       if (string[0] == '"')
-               ++string;
-       else
-               return -ENODEV;
-
-       temp = strsep(&string, "\"");
-       if (!string || temp[0] == '\0')
-               return -ENODEV;
-       *right = temp;
-       *orig_string = string;
-
-       return 0;
-}
-
 int file_map(const char *filename, char **buf, size_t *bufsize)
 {
        struct stat stats;