From bf2f40828ee26d3ba9185f29db596ee5d7b9cf61 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Wed, 23 Dec 2015 14:06:31 -0600 Subject: Remove multicall binary structure from OpenRC This eliminates the need for the selinux-specific wrapper scrript we were installing in /lib*/rc/{bin,sbin}. --- src/rc/_usage.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'src/rc/_usage.c') diff --git a/src/rc/_usage.c b/src/rc/_usage.c index e190eb40..f0c7f0fc 100644 --- a/src/rc/_usage.c +++ b/src/rc/_usage.c @@ -10,8 +10,12 @@ * except according to the terms contained in the LICENSE file. */ -#include "version.h" #include +#include +#include +#include "rc-misc.h" +#include "_usage.h" +#include "version.h" #if lint # define _noreturn @@ -22,7 +26,7 @@ # define _noreturn #endif -static void set_quiet_options(void) +void set_quiet_options(void) { static int qcount = 0; @@ -37,8 +41,7 @@ static void set_quiet_options(void) } } -_noreturn static void -show_version(void) +_noreturn void show_version(void) { const char *systype = NULL; @@ -56,8 +59,7 @@ show_version(void) exit(EXIT_SUCCESS); } -_noreturn static void -usage(int exit_status) +_noreturn void usage(int exit_status) { const char * const has_arg[] = { "", "", "[arg]" }; int i; @@ -67,15 +69,15 @@ usage(int exit_status) char *token; char val[4] = "-?,"; -#ifdef usagestring - printf(usagestring); -#else - printf("Usage: %s [options] ", applet); -#endif -#ifdef extraopts - printf(extraopts); -#endif - printf("\n\nOptions: [" getoptstring "]\n"); + if (usagestring) + printf("%s", usagestring); + else + printf("Usage: %s [options] ", applet); + + if (extraopts) + printf("%s", extraopts); + + printf("\n\nOptions: [ %s ]\n", getoptstring); for (i = 0; longopts[i].name; ++i) { val[1] = longopts[i].val; len = printf(" %3s --%s %s", isprint(longopts[i].val) ? val : "", -- cgit v1.2.3