aboutsummaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
Diffstat (limited to 'runit')
-rw-r--r--runit/chpst.c7
-rw-r--r--runit/runsvdir.c3
-rw-r--r--runit/sv.c5
-rw-r--r--runit/svlogd.c7
4 files changed, 12 insertions, 10 deletions
diff --git a/runit/chpst.c b/runit/chpst.c
index c061a91ea..3ecb85cba 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -301,9 +301,10 @@ int chpst_main(int argc UNUSED_PARAM, char **argv)
// FIXME: can we live with int-sized limits?
// can we live with 40000 days?
// if yes -> getopt converts strings to numbers for us
- opt_complementary = "-1";
- opt = getopt32(argv, "+a:+c:+d:+f:+l:+m:+o:+p:+r:+s:+t:+u:U:e:"
- IF_CHPST("/:n:vP012"),
+ opt = getopt32(argv, "^+"
+ "a:+c:+d:+f:+l:+m:+o:+p:+r:+s:+t:+u:U:e:"
+ IF_CHPST("/:n:vP012")
+ "\0" "-1",
&limita, &limitc, &limitd, &limitf, &limitl,
&limitm, &limito, &limitp, &limitr, &limits, &limitt,
&set_user, &set_user, &env_dir
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index abba2e8e4..11ab40abf 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -248,10 +248,9 @@ int runsvdir_main(int argc UNUSED_PARAM, char **argv)
INIT_G();
- opt_complementary = "-1";
opt_s_argv[0] = NULL;
opt_s_argv[2] = NULL;
- getopt32(argv, "Ps:", &opt_s_argv[0]);
+ getopt32(argv, "^" "Ps:" "\0" "-1", &opt_s_argv[0]);
argv += optind;
i_am_init = (getpid() == 1);
diff --git a/runit/sv.c b/runit/sv.c
index 477c1ac6e..1d0809be8 100644
--- a/runit/sv.c
+++ b/runit/sv.c
@@ -506,8 +506,9 @@ static int sv(char **argv)
x = getenv("SVWAIT");
if (x) waitsec = xatou(x);
- opt_complementary = "vv"; /* -w N, -v is a counter */
- getopt32(argv, "w:+v", &waitsec, &verbose);
+ getopt32(argv, "^" "w:+v" "\0" "vv" /* -w N, -v is a counter */,
+ &waitsec, &verbose
+ );
argv += optind;
action = *argv++;
if (!action || !*argv) bb_show_usage();
diff --git a/runit/svlogd.c b/runit/svlogd.c
index 831873d86..739483356 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -1037,9 +1037,10 @@ int svlogd_main(int argc, char **argv)
INIT_G();
- opt_complementary = "tt:vv";
- opt = getopt32(argv, "r:R:l:b:tv",
- &r, &replace, &l, &b, &timestamp, &verbose);
+ opt = getopt32(argv, "^"
+ "r:R:l:b:tv" "\0" "tt:vv",
+ &r, &replace, &l, &b, &timestamp, &verbose
+ );
if (opt & 1) { // -r
repl = r[0];
if (!repl || r[1])