From d2b31081d3e7718ebefd85a54e0fec03f127eaba Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 30 Nov 2015 16:05:10 +0100 Subject: Remove option parsing We now always run as init itself, so there's no need for option parsing --- src/unitd/unitd.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/unitd/unitd.c b/src/unitd/unitd.c index abbf1b6..be7899a 100644 --- a/src/unitd/unitd.c +++ b/src/unitd/unitd.c @@ -21,27 +21,15 @@ #include #include -#include -#include #include unsigned int debug = 4; -static int usage(const char *prog) -{ - ERROR("Usage: %s [options]\n" - "Options:\n" - "\t-s \tPath to ubus socket\n" - "\t-d \tEnable debug messages\n" - "\n", prog); - return 1; -} -int main(int argc, char **argv) +int main() { static char unitd[] = "unitd"; - int ch; if (getpid() != 1) { fprintf(stderr, "error: must run as PID 1\n"); @@ -53,18 +41,6 @@ int main(int argc, char **argv) ulog_open(ULOG_KMSG, LOG_DAEMON, "unitd"); - while ((ch = getopt(argc, argv, "d:s:")) != -1) { - switch (ch) { - case 's': - ubus_socket = optarg; - break; - case 'd': - debug = atoi(optarg); - break; - default: - return usage(argv[0]); - } - } setsid(); uloop_init(); unitd_signal(); -- cgit v1.2.3