diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-11-30 16:05:10 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-11-30 16:05:49 +0100 |
commit | d2b31081d3e7718ebefd85a54e0fec03f127eaba (patch) | |
tree | d35b0fc77b8ab10b7426d565da3b02614100e653 /src | |
parent | 8ea24440010fb2151611976cb776ccacfdd5fc8d (diff) | |
download | unitd-d2b31081d3e7718ebefd85a54e0fec03f127eaba.tar unitd-d2b31081d3e7718ebefd85a54e0fec03f127eaba.zip |
We now always run as init itself, so there's no need for option parsing
Diffstat (limited to 'src')
-rw-r--r-- | src/unitd/unitd.c | 26 |
1 files changed, 1 insertions, 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 <sys/prctl.h> #include <errno.h> -#include <getopt.h> -#include <string.h> #include <unistd.h> unsigned int debug = 4; -static int usage(const char *prog) -{ - ERROR("Usage: %s [options]\n" - "Options:\n" - "\t-s <path>\tPath to ubus socket\n" - "\t-d <level>\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(); |