summaryrefslogtreecommitdiff
path: root/udev-add.c
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2003-10-22 23:48:55 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:06:22 -0700
commit1e959a4b05f93bf31d0603a027b50cb148ef7e90 (patch)
tree535e27110fb4f6359466cbbaf2bda0e0d00b84cc /udev-add.c
parentc8ba857171bd09a0019d3182fe989c6cf06d98d2 (diff)
[PATCH] klibc specific tweaks
Diffstat (limited to 'udev-add.c')
-rw-r--r--udev-add.c9
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));