projects
/
platform
/
upstream
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e9cf37
)
Walt Wimer noticed that mknod couldn't handle major or minor > 255. Now our
author
Rob Landley
<rob@landley.net>
Mon, 6 Mar 2006 19:31:39 +0000
(19:31 -0000)
committer
Rob Landley
<rob@landley.net>
Mon, 6 Mar 2006 19:31:39 +0000
(19:31 -0000)
limit checking autodetects what the system supports (at compile time).
coreutils/mknod.c
patch
|
blob
|
history
diff --git
a/coreutils/mknod.c
b/coreutils/mknod.c
index
7b2467b
..
b6e8527
100644
(file)
--- a/
coreutils/mknod.c
+++ b/
coreutils/mknod.c
@@
-47,8
+47,10
@@
extern int mknod_main(int argc, char **argv)
dev = 0;
if ((*name != 'p') && ((argc -= 2) == 2)) {
- dev = (bb_xgetularg10_bnd(argv[2], 0, 255) << 8)
- + bb_xgetularg10_bnd(argv[3], 0, 255);
+ /* Autodetect what the system supports; thexe macros should
+ * optimize out to two constants. */
+ dev = makedev(bb_xgetularg10_bnd(argv[2], 0, major(UINT_MAX)),
+ bb_xgetularg10_bnd(argv[3], 0, minor(UINT_MAX)));
}
if (argc == 2) {