X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev_utils.c;h=c6658e6933fbcc0a795d26c3dcbf71044aabf19a;hb=3e5958dee5f24283eb5c6a2d2d95e1a39428a3b8;hp=d572581f656b1f4822dc89fc81289a984a298c33;hpb=63f61c5cf639953aa38e025485919b0aa1c49b59;p=elogind.git diff --git a/udev_utils.c b/udev_utils.c index d572581f6..c6658e693 100644 --- a/udev_utils.c +++ b/udev_utils.c @@ -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;