summaryrefslogtreecommitdiff
path: root/miscutils/makedevs.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2007-01-21 11:20:01 +0000
committerBernhard Reutner-Fischer2007-01-21 11:20:01 +0000
commit7b1f23610f4e9ba08b1f12e25fb1301b321bf584 (patch)
tree811fa15080bb322ebbd4c7be37605a3abbcdf1c7 /miscutils/makedevs.c
parent2f0c0d0b8829b8aea97bc09833e172c59b55cd94 (diff)
downloadbusybox-7b1f23610f4e9ba08b1f12e25fb1301b321bf584.zip
busybox-7b1f23610f4e9ba08b1f12e25fb1301b321bf584.tar.gz
- use makedev to get device number, else it gives wrong major/minor numbers to devices files on systems which use big device numbers.
Closes #919
Diffstat (limited to 'miscutils/makedevs.c')
-rw-r--r--miscutils/makedevs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c
index c25bdad..5602c22 100644
--- a/miscutils/makedevs.c
+++ b/miscutils/makedevs.c
@@ -185,7 +185,7 @@ int makedevs_main(int argc, char **argv)
full_name_inc = xmalloc(strlen(full_name) + 4);
for (i = start; i < count; i++) {
sprintf(full_name_inc, "%s%d", full_name, i);
- rdev = (major << 8) + minor + (i * increment - start);
+ rdev = makedev(major, minor + (i * increment - start));
if (mknod(full_name_inc, mode, rdev) == -1) {
bb_perror_msg("line %d: cannot create node %s", linenum, full_name_inc);
ret = EXIT_FAILURE;
@@ -201,7 +201,7 @@ int makedevs_main(int argc, char **argv)
}
free(full_name_inc);
} else {
- rdev = (major << 8) + minor;
+ rdev = makedev(major, minor);
if (mknod(full_name, mode, rdev) == -1) {
bb_perror_msg("line %d: cannot create node %s", linenum, full_name);
ret = EXIT_FAILURE;