fbset: fix buglet where we were using wrong pointer

readahead: stop using stdio.h
*: style fixes
This commit is contained in:
Denis Vlasenko
2007-11-06 03:05:54 +00:00
parent 1bec1b980e
commit 6bef3d1d22
14 changed files with 94 additions and 57 deletions

View File

@@ -28,23 +28,29 @@ int mknod_main(int argc, char **argv)
argv += optind;
argc -= optind;
if ((argc >= 2) && ((name = strchr(modes_chars, argv[1][0])) != NULL)) {
mode |= modes_cubp[(int)(name[4])];
if (argc >= 2) {
name = strchr(modes_chars, argv[1][0]);
if (name != NULL) {
mode |= modes_cubp[(int)(name[4])];
dev = 0;
if ((*name != 'p') && ((argc -= 2) == 2)) {
/* Autodetect what the system supports; these macros should
* optimize out to two constants. */
dev = makedev(xatoul_range(argv[2], 0, major(UINT_MAX)),
xatoul_range(argv[3], 0, minor(UINT_MAX)));
}
if (argc == 2) {
name = *argv;
if (mknod(name, mode, dev) == 0) {
return EXIT_SUCCESS;
dev = 0;
if (*name != 'p') {
argc -= 2;
if (argc == 2) {
/* Autodetect what the system supports; these macros should
* optimize out to two constants. */
dev = makedev(xatoul_range(argv[2], 0, major(UINT_MAX)),
xatoul_range(argv[3], 0, minor(UINT_MAX)));
}
}
if (argc == 2) {
name = *argv;
if (mknod(name, mode, dev) == 0) {
return EXIT_SUCCESS;
}
bb_simple_perror_msg_and_die(name);
}
bb_simple_perror_msg_and_die(name);
}
}
bb_show_usage();