aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/run_parts.c14
-rw-r--r--debianutils/start_stop_daemon.c12
2 files changed, 15 insertions, 11 deletions
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c
index c6a90a486..b770383c4 100644
--- a/debianutils/run_parts.c
+++ b/debianutils/run_parts.c
@@ -159,10 +159,15 @@ static const char runparts_longopts[] ALIGN1 =
"reverse\0" No_argument "\xf0"
"test\0" No_argument "\xf1"
"exit-on-error\0" No_argument "\xf2"
-#if ENABLE_FEATURE_RUN_PARTS_FANCY
+# if ENABLE_FEATURE_RUN_PARTS_FANCY
"list\0" No_argument "\xf3"
-#endif
+# endif
;
+# define GETOPT32 getopt32long
+# define LONGOPTS ,runparts_longopts
+#else
+# define GETOPT32 getopt32
+# define LONGOPTS
#endif
int run_parts_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -175,12 +180,9 @@ int run_parts_main(int argc UNUSED_PARAM, char **argv)
INIT_G();
-#if ENABLE_FEATURE_RUN_PARTS_LONG_OPTIONS
- applet_long_options = runparts_longopts;
-#endif
/* We require exactly one argument: the directory name */
opt_complementary = "=1";
- getopt32(argv, "a:*u:", &arg_list, &umask_p);
+ GETOPT32(argv, "a:*u:" LONGOPTS, &arg_list, &umask_p);
umask(xstrtou_range(umask_p, 8, 0, 07777));
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 9effdc80b..45c277a53 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -426,6 +426,11 @@ static const char start_stop_daemon_longopts[] ALIGN1 =
"retry\0" Required_argument "R"
# endif
;
+# define GETOPT32 getopt32long
+# define LONGOPTS start_stop_daemon_longopts,
+#else
+# define GETOPT32 getopt32
+# define LONGOPTS
#endif
int start_stop_daemon_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
@@ -446,10 +451,6 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
INIT_G();
-#if ENABLE_FEATURE_START_STOP_DAEMON_LONG_OPTIONS
- applet_long_options = start_stop_daemon_longopts;
-#endif
-
/* -K or -S is required; they are mutually exclusive */
/* -p is required if -m is given */
/* -xpun (at least one) is required if -K is given */
@@ -457,8 +458,9 @@ int start_stop_daemon_main(int argc UNUSED_PARAM, char **argv)
/* -q turns off -v */
opt_complementary = "K:S:K--S:S--K:m?p:K?xpun:S?xa"
IF_FEATURE_START_STOP_DAEMON_FANCY("q-v");
- opt = getopt32(argv, "KSbqtma:n:s:u:c:x:p:"
+ opt = GETOPT32(argv, "KSbqtma:n:s:u:c:x:p:"
IF_FEATURE_START_STOP_DAEMON_FANCY("ovN:R:"),
+ LONGOPTS
&startas, &cmdname, &signame, &userspec, &chuid, &execname, &pidfile
IF_FEATURE_START_STOP_DAEMON_FANCY(,&opt_N)
/* We accept and ignore -R <param> / --retry <param> */