diff options
author | kay.sievers@vrfy.org <kay.sievers@vrfy.org> | 2005-03-06 06:16:52 +0100 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 23:48:48 -0700 |
commit | 57e1a2770c4d85edd377488906c437f6d1e9b369 (patch) | |
tree | 1418c47cf859ef5bea9a21b181c16258d295cd66 /udev_add.c | |
parent | 5f335ca4afaa189799225f856f3af8b3d9fd2e1c (diff) |
[PATCH] remove Makefile magic for klibc integration
The new libsysfs and klibc don't need that anymore.
Wrap getpwnam(), so we can use the built-in /etc/passwd
parser for statically compiled glibc binaries too.
Diffstat (limited to 'udev_add.c')
-rw-r--r-- | udev_add.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/udev_add.c b/udev_add.c index aa19d874c3..e05710ce81 100644 --- a/udev_add.c +++ b/udev_add.c @@ -34,9 +34,9 @@ #include <sys/socket.h> #include <sys/ioctl.h> #include <linux/sockios.h> -#include <pwd.h> #include "libsysfs/sysfs/libsysfs.h" +#include "udev_libc_wrapper.h" #include "udev.h" #include "udev_utils.h" #include "udev_sysfs.h" @@ -132,15 +132,8 @@ static int create_node(struct udevice *udev, struct sysfs_class_device *class_de if (endptr[0] == '\0') uid = (uid_t) id; - else { - struct passwd *pw; - - pw = getpwnam(udev->owner); - if (pw == NULL) - dbg("specified user unknown '%s'", udev->owner); - else - uid = pw->pw_uid; - } + else + uid = lookup_user(udev->owner); } if (udev->group[0] != '\0') { @@ -149,13 +142,8 @@ static int create_node(struct udevice *udev, struct sysfs_class_device *class_de if (endptr[0] == '\0') gid = (gid_t) id; - else { - struct group *gr = getgrnam(udev->group); - if (gr == NULL) - dbg("specified group unknown '%s'", udev->group); - else - gid = gr->gr_gid; - } + else + gid = lookup_group(udev->group); } if (!udev->test_run) { |