diff options
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/adjtimex.c | 8 | ||||
-rw-r--r-- | miscutils/raidautorun.c | 8 | ||||
-rw-r--r-- | miscutils/rx.c | 7 |
3 files changed, 7 insertions, 16 deletions
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c index 07f0834..c12a10b 100644 --- a/miscutils/adjtimex.c +++ b/miscutils/adjtimex.c @@ -56,7 +56,7 @@ static const char ret_code_descript[] = ; int adjtimex_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; -int adjtimex_main(int argc, char **argv) +int adjtimex_main(int argc UNUSED_PARAM, char **argv) { enum { OPT_quiet = 0x1 @@ -66,10 +66,11 @@ int adjtimex_main(int argc, char **argv) struct timex txc; int i, ret; const char *descript; - txc.modes=0; + opt_complementary = "=0"; /* no valid non-option parameters */ opt = getopt32(argv, "qo:f:p:t:", &opt_o, &opt_f, &opt_p, &opt_t); + txc.modes = 0; //if (opt & 0x1) // -q if (opt & 0x2) { // -o txc.offset = xatol(opt_o); @@ -87,9 +88,6 @@ int adjtimex_main(int argc, char **argv) txc.tick = xatol(opt_t); txc.modes |= ADJ_TICK; } - if (argc != optind) { /* no valid non-option parameters */ - bb_show_usage(); - } ret = adjtimex(&txc); diff --git a/miscutils/raidautorun.c b/miscutils/raidautorun.c index a2a852b..113e49f 100644 --- a/miscutils/raidautorun.c +++ b/miscutils/raidautorun.c @@ -14,12 +14,8 @@ #include <linux/raid/md_u.h> int raidautorun_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; -int raidautorun_main(int argc, char **argv) +int raidautorun_main(int argc UNUSED_PARAM, char **argv) { - if (argc != 2) - bb_show_usage(); - - xioctl(xopen(argv[1], O_RDONLY), RAID_AUTORUN, NULL); - + xioctl(xopen(single_argv(argv), O_RDONLY), RAID_AUTORUN, NULL); return EXIT_SUCCESS; } diff --git a/miscutils/rx.c b/miscutils/rx.c index 3a8b6a8..4c5d5a1 100644 --- a/miscutils/rx.c +++ b/miscutils/rx.c @@ -234,21 +234,18 @@ static void sigalrm_handler(int UNUSED_PARAM signum) } int rx_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; -int rx_main(int argc, char **argv) +int rx_main(int argc UNUSED_PARAM, char **argv) { struct termios tty, orig_tty; int termios_err; int file_fd; int n; - if (argc != 2) - bb_show_usage(); - /* Disabled by vda: * why we can't receive from stdin? Why we *require* * controlling tty?? */ /*read_fd = xopen(CURRENT_TTY, O_RDWR);*/ - file_fd = xopen(argv[1], O_RDWR|O_CREAT|O_TRUNC); + file_fd = xopen(single_argv(argv), O_RDWR|O_CREAT|O_TRUNC); termios_err = tcgetattr(read_fd, &tty); if (termios_err == 0) { |