aboutsummaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-28 15:18:53 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-28 15:18:53 +0100
commite992bae6f9adf3718c6263a36c004ead1c7272a8 (patch)
treef0bc9e4fa145f58ab3f9838902e09f9cfba29648 /miscutils
parent86cfb70ca5f2bde11f2d071bc59db75291d8552f (diff)
downloadbusybox-w32-e992bae6f9adf3718c6263a36c004ead1c7272a8.tar.gz
busybox-w32-e992bae6f9adf3718c6263a36c004ead1c7272a8.tar.bz2
busybox-w32-e992bae6f9adf3718c6263a36c004ead1c7272a8.zip
*: remove a few more cases of argc usage. -89 bytes.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/adjtimex.c8
-rw-r--r--miscutils/raidautorun.c8
-rw-r--r--miscutils/rx.c7
3 files changed, 7 insertions, 16 deletions
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index 07f083428..c12a10b25 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -56,7 +56,7 @@ static const char ret_code_descript[] =
56; 56;
57 57
58int adjtimex_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 58int adjtimex_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
59int adjtimex_main(int argc, char **argv) 59int adjtimex_main(int argc UNUSED_PARAM, char **argv)
60{ 60{
61 enum { 61 enum {
62 OPT_quiet = 0x1 62 OPT_quiet = 0x1
@@ -66,10 +66,11 @@ int adjtimex_main(int argc, char **argv)
66 struct timex txc; 66 struct timex txc;
67 int i, ret; 67 int i, ret;
68 const char *descript; 68 const char *descript;
69 txc.modes=0;
70 69
70 opt_complementary = "=0"; /* no valid non-option parameters */
71 opt = getopt32(argv, "qo:f:p:t:", 71 opt = getopt32(argv, "qo:f:p:t:",
72 &opt_o, &opt_f, &opt_p, &opt_t); 72 &opt_o, &opt_f, &opt_p, &opt_t);
73 txc.modes = 0;
73 //if (opt & 0x1) // -q 74 //if (opt & 0x1) // -q
74 if (opt & 0x2) { // -o 75 if (opt & 0x2) { // -o
75 txc.offset = xatol(opt_o); 76 txc.offset = xatol(opt_o);
@@ -87,9 +88,6 @@ int adjtimex_main(int argc, char **argv)
87 txc.tick = xatol(opt_t); 88 txc.tick = xatol(opt_t);
88 txc.modes |= ADJ_TICK; 89 txc.modes |= ADJ_TICK;
89 } 90 }
90 if (argc != optind) { /* no valid non-option parameters */
91 bb_show_usage();
92 }
93 91
94 ret = adjtimex(&txc); 92 ret = adjtimex(&txc);
95 93
diff --git a/miscutils/raidautorun.c b/miscutils/raidautorun.c
index a2a852bbf..113e49ff2 100644
--- a/miscutils/raidautorun.c
+++ b/miscutils/raidautorun.c
@@ -14,12 +14,8 @@
14#include <linux/raid/md_u.h> 14#include <linux/raid/md_u.h>
15 15
16int raidautorun_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 16int raidautorun_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
17int raidautorun_main(int argc, char **argv) 17int raidautorun_main(int argc UNUSED_PARAM, char **argv)
18{ 18{
19 if (argc != 2) 19 xioctl(xopen(single_argv(argv), O_RDONLY), RAID_AUTORUN, NULL);
20 bb_show_usage();
21
22 xioctl(xopen(argv[1], O_RDONLY), RAID_AUTORUN, NULL);
23
24 return EXIT_SUCCESS; 20 return EXIT_SUCCESS;
25} 21}
diff --git a/miscutils/rx.c b/miscutils/rx.c
index 3a8b6a8fe..4c5d5a19c 100644
--- a/miscutils/rx.c
+++ b/miscutils/rx.c
@@ -234,21 +234,18 @@ static void sigalrm_handler(int UNUSED_PARAM signum)
234} 234}
235 235
236int rx_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 236int rx_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
237int rx_main(int argc, char **argv) 237int rx_main(int argc UNUSED_PARAM, char **argv)
238{ 238{
239 struct termios tty, orig_tty; 239 struct termios tty, orig_tty;
240 int termios_err; 240 int termios_err;
241 int file_fd; 241 int file_fd;
242 int n; 242 int n;
243 243
244 if (argc != 2)
245 bb_show_usage();
246
247 /* Disabled by vda: 244 /* Disabled by vda:
248 * why we can't receive from stdin? Why we *require* 245 * why we can't receive from stdin? Why we *require*
249 * controlling tty?? */ 246 * controlling tty?? */
250 /*read_fd = xopen(CURRENT_TTY, O_RDWR);*/ 247 /*read_fd = xopen(CURRENT_TTY, O_RDWR);*/
251 file_fd = xopen(argv[1], O_RDWR|O_CREAT|O_TRUNC); 248 file_fd = xopen(single_argv(argv), O_RDWR|O_CREAT|O_TRUNC);
252 249
253 termios_err = tcgetattr(read_fd, &tty); 250 termios_err = tcgetattr(read_fd, &tty);
254 if (termios_err == 0) { 251 if (termios_err == 0) {