aboutsummaryrefslogtreecommitdiff
path: root/src/rc/swclock.c
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2015-12-23 14:06:31 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2016-01-12 10:42:14 -0600
commitbf2f40828ee26d3ba9185f29db596ee5d7b9cf61 (patch)
treede1ccdb2fd86e476323908c37ae6588a9ac9ae97 /src/rc/swclock.c
parentfe485f44339963fdbee143687dcbef2069924bc6 (diff)
Remove multicall binary structure from OpenRC
This eliminates the need for the selinux-specific wrapper scrript we were installing in /lib*/rc/{bin,sbin}.
Diffstat (limited to 'src/rc/swclock.c')
-rw-r--r--src/rc/swclock.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/rc/swclock.c b/src/rc/swclock.c
index 2c7e8b8e..4b62a460 100644
--- a/src/rc/swclock.c
+++ b/src/rc/swclock.c
@@ -25,40 +25,39 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
+#include <stdio.h>
#include <unistd.h>
#include <utime.h>
-#include "builtins.h"
#include "einfo.h"
#include "rc-misc.h"
+#include "_usage.h"
#define RC_SHUTDOWNTIME RC_SVCDIR "/shutdowntime"
-extern const char *applet;
-
-#include "_usage.h"
-#define extraopts "file"
-#define getoptstring "sw" getoptstring_COMMON
-static const struct option longopts[] = {
+const char *applet = NULL;
+const char *extraopts = "file";
+const char *getoptstring = "sw" getoptstring_COMMON;
+const struct option longopts[] = {
{ "save", 0, NULL, 's' },
{ "warn", 0, NULL, 'w' },
longopts_COMMON
};
-static const char * const longopts_help[] = {
+const char * const longopts_help[] = {
"saves the time",
"no error if no reference file",
longopts_help_COMMON
};
-#include "_usage.c"
+const char *usagestring = NULL;
-int
-swclock(int argc, char **argv)
+int main(int argc, char **argv)
{
int opt, sflag = 0, wflag = 0;
const char *file = RC_SHUTDOWNTIME;
struct stat sb;
struct timeval tv;
+ applet = basename_c(argv[0]);
while ((opt = getopt_long(argc, argv, getoptstring,
longopts, (int *) 0)) != -1)
{