summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenis Vlasenko2006-10-03 21:00:06 +0000
committerDenis Vlasenko2006-10-03 21:00:06 +0000
commit67b23e6043d8e2b30b0bf3bc105b8583c2a26db5 (patch)
treeedb58560b444979051b42ab7f0c0c718f7459754 /loginutils
parent40920825d59874cf285390434486e88c8498d2d8 (diff)
downloadbusybox-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.zip
busybox-67b23e6043d8e2b30b0bf3bc105b8583c2a26db5.tar.gz
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.c4
-rw-r--r--loginutils/adduser.c4
-rw-r--r--loginutils/getty.c2
-rw-r--r--loginutils/login.c4
-rw-r--r--loginutils/passwd.c4
-rw-r--r--loginutils/su.c2
-rw-r--r--loginutils/sulogin.c2
-rw-r--r--loginutils/vlock.c2
8 files changed, 12 insertions, 12 deletions
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index 13f29bf..236dc10 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -90,9 +90,9 @@ int addgroup_main(int argc, char **argv)
gid_t gid = 0;
/* check for min, max and missing args and exit on error */
- bb_opt_complementally = "-1:?2:?";
+ opt_complementary = "-1:?2:?";
- if (bb_getopt_ulflags(argc, argv, "g:", &group)) {
+ if (getopt32(argc, argv, "g:", &group)) {
gid = bb_xgetlarg(group, 10, 0, LONG_MAX);
}
/* move past the commandline options */
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index 936e48e..8101b20 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -169,8 +169,8 @@ int adduser_main(int argc, char **argv)
pw.pw_dir = NULL;
/* check for min, max and missing args and exit on error */
- bb_opt_complementally = "-1:?1:?";
- flags = bb_getopt_ulflags(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup);
+ opt_complementary = "-1:?1:?";
+ flags = getopt32(argc, argv, "h:g:s:G:DSH", &pw.pw_dir, &pw.pw_gecos, &pw.pw_shell, &usegroup);
/* got root? */
if(geteuid()) {
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 22601c7..6730fa8 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -258,7 +258,7 @@ static void parse_args(int argc, char **argv, struct options *op)
{
char *ts;
- op->flags = bb_getopt_ulflags(argc, argv, opt_string,
+ op->flags = getopt32(argc, argv, opt_string,
&(op->initstring), &fakehost, &(op->issue),
&(op->login), &ts);
if(op->flags & F_INITSTRING) {
diff --git a/loginutils/login.c b/loginutils/login.c
index 1b13fa0..1f392c1 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -222,7 +222,7 @@ int login_main(int argc, char **argv)
char username[USERNAME_SIZE];
const char *tmp;
int amroot;
- unsigned long opt;
+ unsigned opt;
int count = 0;
struct passwd *pw;
char *opt_host = NULL;
@@ -234,7 +234,7 @@ int login_main(int argc, char **argv)
signal(SIGALRM, alarm_handler);
alarm(TIMEOUT);
- opt = bb_getopt_ulflags(argc, argv, "f:h:p", &opt_user, &opt_host);
+ opt = getopt32(argc, argv, "f:h:p", &opt_user, &opt_host);
if (opt & LOGIN_OPT_f) {
if (!amroot)
bb_error_msg_and_die("-f is for root only");
diff --git a/loginutils/passwd.c b/loginutils/passwd.c
index 211a49e..54f35d2 100644
--- a/loginutils/passwd.c
+++ b/loginutils/passwd.c
@@ -134,7 +134,7 @@ int passwd_main(int argc, char **argv)
OPT_delete = 0x8, /* -d - delete password */
OPT_lud = 0xe,
};
- unsigned long opt;
+ unsigned opt;
char *opt_a;
int amroot;
char *cp;
@@ -146,7 +146,7 @@ int passwd_main(int argc, char **argv)
amroot = (getuid() == 0);
openlog("passwd", LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH);
- opt = bb_getopt_ulflags(argc, argv, "a:lud", &opt_a);
+ opt = getopt32(argc, argv, "a:lud", &opt_a);
argc -= optind;
argv += optind;
if (opt & OPT_algo) algo = get_algo(opt_a); // -a
diff --git a/loginutils/su.c b/loginutils/su.c
index c51359a..7894201 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -20,7 +20,7 @@ int su_main(int argc, char **argv)
const char *tty;
char *old_user;
- flags = bb_getopt_ulflags(argc, argv, "mplc:s:", &opt_command, &opt_shell);
+ flags = getopt32(argc, argv, "mplc:s:", &opt_command, &opt_shell);
#define SU_OPT_mp (3)
#define SU_OPT_l (4)
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 8cfb64e..6edd258 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -46,7 +46,7 @@ int sulogin_main(int argc, char **argv)
logmode = LOGMODE_BOTH;
openlog(bb_applet_name, 0, LOG_AUTH);
- if (bb_getopt_ulflags (argc, argv, "t:", &timeout_arg)) {
+ if (getopt32 (argc, argv, "t:", &timeout_arg)) {
if (safe_strtoi(timeout_arg, &timeout)) {
timeout = 0;
}
diff --git a/loginutils/vlock.c b/loginutils/vlock.c
index d472c09..02d1ea7 100644
--- a/loginutils/vlock.c
+++ b/loginutils/vlock.c
@@ -55,7 +55,7 @@ int vlock_main(int argc, char **argv)
bb_show_usage();
}
- o_lock_all = bb_getopt_ulflags (argc, argv, "a");
+ o_lock_all = getopt32 (argc, argv, "a");
if((pw = getpwuid(getuid())) == NULL) {
bb_error_msg_and_die("Unknown uid %d", getuid());