diff options
author | greg@kroah.com <greg@kroah.com> | 2003-10-22 23:48:55 -0700 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:06:22 -0700 |
commit | 1e959a4b05f93bf31d0603a027b50cb148ef7e90 (patch) | |
tree | 535e27110fb4f6359466cbbaf2bda0e0d00b84cc /udev-add.c | |
parent | c8ba857171bd09a0019d3182fe989c6cf06d98d2 (diff) |
[PATCH] klibc specific tweaks
Diffstat (limited to 'udev-add.c')
-rw-r--r-- | udev-add.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/udev-add.c b/udev-add.c index 8c63214a46..7a89076add 100644 --- a/udev-add.c +++ b/udev-add.c @@ -73,10 +73,17 @@ static int create_node(struct udevice *dev) { char filename[255]; int retval = 0; + dev_t res; strncpy(filename, udev_root, sizeof(filename)); strncat(filename, dev->name, sizeof(filename)); +#ifdef __KLIBC__ + res = (dev->major << 8) | (dev->minor); +#else + res = makedev(dev->major, dev->minor); +#endif + switch (dev->type) { case 'b': dev->mode |= S_IFBLK; @@ -94,7 +101,7 @@ static int create_node(struct udevice *dev) } dbg("mknod(%s, %#o, %u, %u)", filename, dev->mode, dev->major, dev->minor); - retval = mknod(filename, dev->mode, makedev(dev->major, dev->minor)); + retval = mknod(filename, dev->mode, res); if (retval) dbg("mknod(%s, %#o, %u, %u) failed with error '%s'", filename, dev->mode, dev->major, dev->minor, strerror(errno)); |