summaryrefslogtreecommitdiff
path: root/udev-add.c
diff options
context:
space:
mode:
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));