Walt Wimer noticed that mknod couldn't handle major or minor > 255. Now our
limit checking autodetects what the system supports (at compile time).
This commit is contained in:
parent
2e9cf373a9
commit
1f5e25bf3e
@ -47,8 +47,10 @@ extern int mknod_main(int argc, char **argv)
|
|||||||
|
|
||||||
dev = 0;
|
dev = 0;
|
||||||
if ((*name != 'p') && ((argc -= 2) == 2)) {
|
if ((*name != 'p') && ((argc -= 2) == 2)) {
|
||||||
dev = (bb_xgetularg10_bnd(argv[2], 0, 255) << 8)
|
/* Autodetect what the system supports; thexe macros should
|
||||||
+ bb_xgetularg10_bnd(argv[3], 0, 255);
|
* 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) {
|
if (argc == 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user