summaryrefslogtreecommitdiff
path: root/udev-add.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-01-19 19:44:24 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:17 -0700
commit765cbd97599d943adc73d03f4c91bd7cf7ef7fab (patch)
treeb6ce2967912c4bbcffeefec4e334d65c9abb5da9 /udev-add.c
parent74c73ef994f3ea8d013c33fe7be73e0c0c86977b (diff)
[PATCH] set default owner/group in db - update
I've edited the man page today, so this is alreay included :) Also a few more trivials: o added the defaults to udev.conf.in o removed class_dev from get_default_mode(), to match with Hanna's o changed size of mode_str to MODE_SIZE o changed a few char compares from from 0x00 to '\0'
Diffstat (limited to 'udev-add.c')
-rw-r--r--udev-add.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/udev-add.c b/udev-add.c
index 9aa8bdb3e9..586911acc2 100644
--- a/udev-add.c
+++ b/udev-add.c
@@ -155,29 +155,29 @@ static int create_node(struct udevice *dev)
dbg("chmod(%s, %#o) failed with error '%s'",
filename, dev->mode, strerror(errno));
- if (*dev->owner) {
+ if (dev->owner[0]) {
char *endptr;
unsigned long id = strtoul(dev->owner, &endptr, 10);
- if (*endptr == 0x00)
+ if (endptr[0] == '\0')
uid = (uid_t) id;
else {
struct passwd *pw = getpwnam(dev->owner);
- if (!pw)
- dbg("user unknown '%s'", dev->owner);
+ if (pw == NULL)
+ dbg("specified user unknown '%s'", dev->owner);
else
uid = pw->pw_uid;
}
}
- if (*dev->group) {
+ if (dev->group[0]) {
char *endptr;
unsigned long id = strtoul(dev->group, &endptr, 10);
- if (*endptr == 0x00)
+ if (endptr[0] == '\0')
gid = (gid_t) id;
else {
struct group *gr = getgrnam(dev->group);
- if (!gr)
- dbg("group unknown '%s'", dev->group);
+ if (gr == NULL)
+ dbg("specified group unknown '%s'", dev->group);
else
gid = gr->gr_gid;
}
@@ -192,7 +192,7 @@ static int create_node(struct udevice *dev)
}
/* create symlink if requested */
- if (*dev->symlink) {
+ if (dev->symlink[0]) {
symlinks = dev->symlink;
while (1) {
linkname = strsep(&symlinks, " ");