diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-03 21:00:06 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-10-03 21:00:06 +0000 |
commit | 67b23e6043d8e2b30b0bf3bc105b8583c2a26db5 (patch) | |
tree | edb58560b444979051b42ab7f0c0c718f7459754 /loginutils | |
parent | 40920825d59874cf285390434486e88c8498d2d8 (diff) | |
download | busybox-w32-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.tar.gz busybox-w32-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.tar.bz2 busybox-w32-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.zip |
getopt_ulflags -> getopt32.
It is impossible to formulate sane ABI based on
size of ulong because it can be 32-bit or 64-bit.
Basically it means that you cannot portably use
more that 32 option chars in one call anyway...
Make it explicit.
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/addgroup.c | 4 | ||||
-rw-r--r-- | loginutils/adduser.c | 4 | ||||
-rw-r--r-- | loginutils/getty.c | 2 | ||||
-rw-r--r-- | loginutils/login.c | 4 | ||||
-rw-r--r-- | loginutils/passwd.c | 4 | ||||
-rw-r--r-- | loginutils/su.c | 2 | ||||
-rw-r--r-- | loginutils/sulogin.c | 2 | ||||
-rw-r--r-- | loginutils/vlock.c | 2 |
8 files changed, 12 insertions, 12 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c index 13f29bfa3..236dc1099 100644 --- a/loginutils/addgroup.c +++ b/loginutils/addgroup.c | |||
@@ -90,9 +90,9 @@ int addgroup_main(int argc, char **argv) | |||
90 | gid_t gid = 0; | 90 | gid_t gid = 0; |
91 | 91 | ||
92 | /* check for min, max and missing args and exit on error */ | 92 | /* check for min, max and missing args and exit on error */ |
93 | bb_opt_complementally = "-1:?2:?"; | 93 | opt_complementary = "-1:?2:?"; |
94 | 94 | ||
95 | if (bb_getopt_ulflags(argc, argv, "g:", &group)) { | 95 | if (getopt32(argc, argv, "g:", &group)) { |
96 | gid = bb_xgetlarg(group, 10, 0, LONG_MAX); | 96 | gid = bb_xgetlarg(group, 10, 0, LONG_MAX); |
97 | } | 97 | } |
98 | /* move past the commandline options */ | 98 | /* move past the commandline options */ |
diff --git a/loginutils/adduser.c b/loginutils/adduser.c index 936e48e0a..8101b20b4 100644 --- a/loginutils/adduser.c +++ b/loginutils/adduser.c | |||
@@ -169,8 +169,8 @@ int adduser_main(int argc, char **argv) | |||
169 | pw.pw_dir = NULL; | 169 | pw.pw_dir = NULL; |
170 | 170 | ||
171 | /* check for min, max and missing args and exit on error */ | 171 | /* check for min, max and missing args and exit on error */ |
172 | bb_opt_complementally = "-1:?1:?"; | 172 | opt_complementary = "-1:?1:?"; |
173 | flags = bb_getopt_ulflags(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup); | 173 | flags = getopt32(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup); |
174 | 174 | ||
175 | /* got root? */ | 175 | /* got root? */ |
176 | if(geteuid()) { | 176 | if(geteuid()) { |
diff --git a/loginutils/getty.c b/loginutils/getty.c index 22601c74e..6730fa85c 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
@@ -258,7 +258,7 @@ static void parse_args(int argc, char **argv, struct options *op) | |||
258 | { | 258 | { |
259 | char *ts; | 259 | char *ts; |
260 | 260 | ||
261 | op->flags = bb_getopt_ulflags(argc, argv, opt_string, | 261 | op->flags = getopt32(argc, argv, opt_string, |
262 | &(op->initstring), &fakehost, &(op->issue), | 262 | &(op->initstring), &fakehost, &(op->issue), |
263 | &(op->login), &ts); | 263 | &(op->login), &ts); |
264 | if(op->flags & F_INITSTRING) { | 264 | if(op->flags & F_INITSTRING) { |
diff --git a/loginutils/login.c b/loginutils/login.c index 1b13fa0cc..1f392c10f 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -222,7 +222,7 @@ int login_main(int argc, char **argv) | |||
222 | char username[USERNAME_SIZE]; | 222 | char username[USERNAME_SIZE]; |
223 | const char *tmp; | 223 | const char *tmp; |
224 | int amroot; | 224 | int amroot; |
225 | unsigned long opt; | 225 | unsigned opt; |
226 | int count = 0; | 226 | int count = 0; |
227 | struct passwd *pw; | 227 | struct passwd *pw; |
228 | char *opt_host = NULL; | 228 | char *opt_host = NULL; |
@@ -234,7 +234,7 @@ int login_main(int argc, char **argv) | |||
234 | signal(SIGALRM, alarm_handler); | 234 | signal(SIGALRM, alarm_handler); |
235 | alarm(TIMEOUT); | 235 | alarm(TIMEOUT); |
236 | 236 | ||
237 | opt = bb_getopt_ulflags(argc, argv, "f:h:p", &opt_user, &opt_host); | 237 | opt = getopt32(argc, argv, "f:h:p", &opt_user, &opt_host); |
238 | if (opt & LOGIN_OPT_f) { | 238 | if (opt & LOGIN_OPT_f) { |
239 | if (!amroot) | 239 | if (!amroot) |
240 | bb_error_msg_and_die("-f is for root only"); | 240 | bb_error_msg_and_die("-f is for root only"); |
diff --git a/loginutils/passwd.c b/loginutils/passwd.c index 211a49ea3..54f35d2d5 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c | |||
@@ -134,7 +134,7 @@ int passwd_main(int argc, char **argv) | |||
134 | OPT_delete = 0x8, /* -d - delete password */ | 134 | OPT_delete = 0x8, /* -d - delete password */ |
135 | OPT_lud = 0xe, | 135 | OPT_lud = 0xe, |
136 | }; | 136 | }; |
137 | unsigned long opt; | 137 | unsigned opt; |
138 | char *opt_a; | 138 | char *opt_a; |
139 | int amroot; | 139 | int amroot; |
140 | char *cp; | 140 | char *cp; |
@@ -146,7 +146,7 @@ int passwd_main(int argc, char **argv) | |||
146 | 146 | ||
147 | amroot = (getuid() == 0); | 147 | amroot = (getuid() == 0); |
148 | openlog("passwd", LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH); | 148 | openlog("passwd", LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH); |
149 | opt = bb_getopt_ulflags(argc, argv, "a:lud", &opt_a); | 149 | opt = getopt32(argc, argv, "a:lud", &opt_a); |
150 | argc -= optind; | 150 | argc -= optind; |
151 | argv += optind; | 151 | argv += optind; |
152 | if (opt & OPT_algo) algo = get_algo(opt_a); // -a | 152 | if (opt & OPT_algo) algo = get_algo(opt_a); // -a |
diff --git a/loginutils/su.c b/loginutils/su.c index c51359ae1..78942014e 100644 --- a/loginutils/su.c +++ b/loginutils/su.c | |||
@@ -20,7 +20,7 @@ int su_main(int argc, char **argv) | |||
20 | const char *tty; | 20 | const char *tty; |
21 | char *old_user; | 21 | char *old_user; |
22 | 22 | ||
23 | flags = bb_getopt_ulflags(argc, argv, "mplc:s:", &opt_command, &opt_shell); | 23 | flags = getopt32(argc, argv, "mplc:s:", &opt_command, &opt_shell); |
24 | #define SU_OPT_mp (3) | 24 | #define SU_OPT_mp (3) |
25 | #define SU_OPT_l (4) | 25 | #define SU_OPT_l (4) |
26 | 26 | ||
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c index 8cfb64e9a..6edd2582b 100644 --- a/loginutils/sulogin.c +++ b/loginutils/sulogin.c | |||
@@ -46,7 +46,7 @@ int sulogin_main(int argc, char **argv) | |||
46 | logmode = LOGMODE_BOTH; | 46 | logmode = LOGMODE_BOTH; |
47 | openlog(bb_applet_name, 0, LOG_AUTH); | 47 | openlog(bb_applet_name, 0, LOG_AUTH); |
48 | 48 | ||
49 | if (bb_getopt_ulflags (argc, argv, "t:", &timeout_arg)) { | 49 | if (getopt32 (argc, argv, "t:", &timeout_arg)) { |
50 | if (safe_strtoi(timeout_arg, &timeout)) { | 50 | if (safe_strtoi(timeout_arg, &timeout)) { |
51 | timeout = 0; | 51 | timeout = 0; |
52 | } | 52 | } |
diff --git a/loginutils/vlock.c b/loginutils/vlock.c index d472c0925..02d1ea772 100644 --- a/loginutils/vlock.c +++ b/loginutils/vlock.c | |||
@@ -55,7 +55,7 @@ int vlock_main(int argc, char **argv) | |||
55 | bb_show_usage(); | 55 | bb_show_usage(); |
56 | } | 56 | } |
57 | 57 | ||
58 | o_lock_all = bb_getopt_ulflags (argc, argv, "a"); | 58 | o_lock_all = getopt32 (argc, argv, "a"); |
59 | 59 | ||
60 | if((pw = getpwuid(getuid())) == NULL) { | 60 | if((pw = getpwuid(getuid())) == NULL) { |
61 | bb_error_msg_and_die("Unknown uid %d", getuid()); | 61 | bb_error_msg_and_die("Unknown uid %d", getuid()); |