aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-18 15:32:12 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-18 15:32:12 +0000
commitfe7cd642b0b732f5d41403c2f6983ad676b69dd9 (patch)
treee5962885cb72c976f44b178a350a92ba5f1aa02d /loginutils
parentd6cd9d7fe9eab19a9e36fdda729c78c40205b1e5 (diff)
downloadbusybox-w32-fe7cd642b0b732f5d41403c2f6983ad676b69dd9.tar.gz
busybox-w32-fe7cd642b0b732f5d41403c2f6983ad676b69dd9.tar.bz2
busybox-w32-fe7cd642b0b732f5d41403c2f6983ad676b69dd9.zip
don't pass argc in getopt32, it's superfluous
(add/remove: 0/0 grow/shrink: 12/131 up/down: 91/-727) Total: -636 bytes text data bss dec hex filename 773469 1058 11092 785619 bfcd3 busybox_old 772644 1058 11092 784794 bf99a busybox_unstripped
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/addgroup.c2
-rw-r--r--loginutils/adduser.c2
-rw-r--r--loginutils/chpasswd.c2
-rw-r--r--loginutils/cryptpw.c2
-rw-r--r--loginutils/getty.c2
-rw-r--r--loginutils/login.c2
-rw-r--r--loginutils/passwd.c2
-rw-r--r--loginutils/su.c2
-rw-r--r--loginutils/sulogin.c2
-rw-r--r--loginutils/vlock.c2
10 files changed, 10 insertions, 10 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index cf7cca907..b213074a6 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -139,7 +139,7 @@ int addgroup_main(int argc, char **argv)
139 * addgroup user group 139 * addgroup user group
140 * Check for min, max and missing args */ 140 * Check for min, max and missing args */
141 opt_complementary = "-1:?2"; 141 opt_complementary = "-1:?2";
142 if (getopt32(argc, argv, "g:", &group)) { 142 if (getopt32(argv, "g:", &group)) {
143 gid = xatoul_range(group, 0, ((unsigned long)(gid_t)ULONG_MAX) >> 1); 143 gid = xatoul_range(group, 0, ((unsigned long)(gid_t)ULONG_MAX) >> 1);
144 } 144 }
145 /* move past the commandline options */ 145 /* move past the commandline options */
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 79cd2f4f7..eee4a000d 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -182,7 +182,7 @@ int adduser_main(int argc, char **argv)
182 182
183 /* exactly one non-option arg */ 183 /* exactly one non-option arg */
184 opt_complementary = "=1"; 184 opt_complementary = "=1";
185 getopt32(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup); 185 getopt32(argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup);
186 argv += optind; 186 argv += optind;
187 187
188 /* create a passwd struct */ 188 /* create a passwd struct */
diff --git a/loginutils/chpasswd.c b/loginutils/chpasswd.c
index e2a717a02..61f9b896a 100644
--- a/loginutils/chpasswd.c
+++ b/loginutils/chpasswd.c
@@ -33,7 +33,7 @@ int chpasswd_main(int argc, char **argv)
33 33
34 opt_complementary = "m--e:e--m"; 34 opt_complementary = "m--e:e--m";
35 USE_GETOPT_LONG(applet_long_options = chpasswd_longopts;) 35 USE_GETOPT_LONG(applet_long_options = chpasswd_longopts;)
36 opt = getopt32(argc, argv, "em"); 36 opt = getopt32(argv, "em");
37 37
38 while ((name = xmalloc_getline(stdin)) != NULL) { 38 while ((name = xmalloc_getline(stdin)) != NULL) {
39 pass = strchr(name, ':'); 39 pass = strchr(name, ':');
diff --git a/loginutils/cryptpw.c b/loginutils/cryptpw.c
index 1c3059198..0847857de 100644
--- a/loginutils/cryptpw.c
+++ b/loginutils/cryptpw.c
@@ -12,7 +12,7 @@ int cryptpw_main(int argc, char **argv)
12{ 12{
13 char salt[sizeof("$N$XXXXXXXX")]; 13 char salt[sizeof("$N$XXXXXXXX")];
14 14
15 if (!getopt32(argc, argv, "a:", NULL) || argv[optind - 1][0] != 'd') { 15 if (!getopt32(argv, "a:", NULL) || argv[optind - 1][0] != 'd') {
16 strcpy(salt, "$1$"); 16 strcpy(salt, "$1$");
17 /* Too ugly, and needs even more magic to handle endianness: */ 17 /* Too ugly, and needs even more magic to handle endianness: */
18 //((uint32_t*)&salt)[0] = '$' + '1'*0x100 + '$'*0x10000; 18 //((uint32_t*)&salt)[0] = '$' + '1'*0x100 + '$'*0x10000;
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 8b78856a2..0c000666e 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -180,7 +180,7 @@ static void parse_args(int argc, char **argv, struct options *op)
180{ 180{
181 char *ts; 181 char *ts;
182 182
183 op->flags = getopt32(argc, argv, opt_string, 183 op->flags = getopt32(argv, opt_string,
184 &(op->initstring), &fakehost, &(op->issue), 184 &(op->initstring), &fakehost, &(op->issue),
185 &(op->login), &ts); 185 &(op->login), &ts);
186 if (op->flags & F_INITSTRING) { 186 if (op->flags & F_INITSTRING) {
diff --git a/loginutils/login.c b/loginutils/login.c
index d69e3ce51..7b60fd017 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -239,7 +239,7 @@ int login_main(int argc, char **argv)
239 * (The name of the function is misleading. Not daemonizing here.) */ 239 * (The name of the function is misleading. Not daemonizing here.) */
240 bb_daemonize_or_rexec(DAEMON_ONLY_SANITIZE | DAEMON_CLOSE_EXTRA_FDS, NULL); 240 bb_daemonize_or_rexec(DAEMON_ONLY_SANITIZE | DAEMON_CLOSE_EXTRA_FDS, NULL);
241 241
242 opt = getopt32(argc, argv, "f:h:p", &opt_user, &opt_host); 242 opt = getopt32(argv, "f:h:p", &opt_user, &opt_host);
243 if (opt & LOGIN_OPT_f) { 243 if (opt & LOGIN_OPT_f) {
244 if (!amroot) 244 if (!amroot)
245 bb_error_msg_and_die("-f is for root only"); 245 bb_error_msg_and_die("-f is for root only");
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 4f7094aec..ce333b49e 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -103,7 +103,7 @@ int passwd_main(int argc, char **argv)
103 103
104 logmode = LOGMODE_BOTH; 104 logmode = LOGMODE_BOTH;
105 openlog(applet_name, LOG_NOWAIT, LOG_AUTH); 105 openlog(applet_name, LOG_NOWAIT, LOG_AUTH);
106 opt = getopt32(argc, argv, "a:lud", &opt_a); 106 opt = getopt32(argv, "a:lud", &opt_a);
107 //argc -= optind; 107 //argc -= optind;
108 argv += optind; 108 argv += optind;
109 109
diff --git a/loginutils/su.c b/loginutils/su.c
index fd17319da..b4681fb6a 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -23,7 +23,7 @@ int su_main(int argc, char **argv)
23 const char *tty; 23 const char *tty;
24 char *old_user; 24 char *old_user;
25 25
26 flags = getopt32(argc, argv, "mplc:s:", &opt_command, &opt_shell); 26 flags = getopt32(argv, "mplc:s:", &opt_command, &opt_shell);
27 argc -= optind; 27 argc -= optind;
28 argv += optind; 28 argv += optind;
29 29
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 5638c4bc9..5f0a4081d 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -53,7 +53,7 @@ int sulogin_main(int argc, char **argv)
53 logmode = LOGMODE_BOTH; 53 logmode = LOGMODE_BOTH;
54 openlog(applet_name, 0, LOG_AUTH); 54 openlog(applet_name, 0, LOG_AUTH);
55 55
56 if (getopt32(argc, argv, "t:", &timeout_arg)) { 56 if (getopt32(argv, "t:", &timeout_arg)) {
57 timeout = xatoi_u(timeout_arg); 57 timeout = xatoi_u(timeout_arg);
58 } 58 }
59 59
diff --git a/loginutils/vlock.c b/loginutils/vlock.c
index 665ebd83a..d18a9f272 100644
--- a/loginutils/vlock.c
+++ b/loginutils/vlock.c
@@ -58,7 +58,7 @@ int vlock_main(int argc, char **argv)
58 bb_show_usage(); 58 bb_show_usage();
59 } 59 }
60 60
61 o_lock_all = getopt32(argc, argv, "a"); 61 o_lock_all = getopt32(argv, "a");
62 62
63 vfd = xopen(CURRENT_TTY, O_RDWR); 63 vfd = xopen(CURRENT_TTY, O_RDWR);
64 64