summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-01-21 14:36:25 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2007-01-21 14:36:25 +0000
commit2c7da4d72699ac3d407dadc7432967c8ff4b6750 (patch)
treeda9309ccc1f00819cbc80955b71dc23cd52c4627 /target
parent726abd4e519f97eda6f6dfc1b6b9505fc37e8b23 (diff)
downloadbuildroot-novena-2c7da4d72699ac3d407dadc7432967c8ff4b6750.tar.gz
buildroot-novena-2c7da4d72699ac3d407dadc7432967c8ff4b6750.zip
- 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 'target')
-rw-r--r--target/makedevs/makedevs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/makedevs/makedevs.c b/target/makedevs/makedevs.c
index 4cf853dca..8f4b192d1 100644
--- a/target/makedevs/makedevs.c
+++ b/target/makedevs/makedevs.c
@@ -490,7 +490,7 @@ int 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: Couldnt create node %s", linenum, full_name_inc);
ret = EXIT_FAILURE;
@@ -506,7 +506,7 @@ int 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: Couldnt create node %s", linenum, full_name);
ret = EXIT_FAILURE;