From fdfe16ad3007ba2f02137d479a72e4f61f21ba9f Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 20 Aug 2016 03:17:29 +0200 Subject: [PATCH] Document that init(8) mounts the filesystems of fstab(5). Remove --help and --version in favor of the init(8) manual page. --- init/init.8 | 4 ++++ init/init.c | 34 ++++------------------------------ 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/init/init.8 b/init/init.8 index f85fc8cf..7f64439d 100644 --- a/init/init.8 +++ b/init/init.8 @@ -111,6 +111,10 @@ set keyboard layout (see set graphics resolution (see .Xr videomode 5 ) .El +.Ss Mountpoints +.Nm +mounts all the filesystems according to +.Xr fstab 5 . .Ss Session Finally .Nm diff --git a/init/init.c b/init/init.c index b68a68a8..14006644 100644 --- a/init/init.c +++ b/init/init.c @@ -25,9 +25,9 @@ #include #include +#include #include #include -#include #include #include #include @@ -935,17 +935,6 @@ static void compact_arguments(int* argc, char*** argv) } } -static void help(FILE* fp, const char* argv0) -{ - fprintf(fp, "Usage: %s [OPTION]...\n", argv0); - fprintf(fp, "Initialize and manage the userland.\n"); -} - -static void version(FILE* fp, const char* argv0) -{ - fprintf(fp, "%s (Sortix) %s\n", argv0, VERSIONSTR); -} - int main(int argc, char* argv[]) { main_pid = getpid(); @@ -954,7 +943,6 @@ int main(int argc, char* argv[]) const char* target = NULL; - const char* argv0 = argv[0]; for ( int i = 1; i < argc; i++ ) { const char* arg = argv[i]; @@ -969,9 +957,7 @@ int main(int argc, char* argv[]) while ( (c = *++arg) ) switch ( c ) { default: - fprintf(stderr, "%s: unknown option -- '%c'\n", argv0, c); - help(stderr, argv0); - exit(1); + errx(2, "unknown option -- '%c'", c); } } else if ( !strncmp(arg, "--target=", strlen("--target=")) ) @@ -979,24 +965,12 @@ int main(int argc, char* argv[]) else if ( !strcmp(arg, "--target") ) { if ( i + 1 == argc ) - { - error(0, 0, "option '--target' requires an argument"); - fprintf(stderr, "Try `%s --help' for more information.\n", argv[0]); - exit(125); - } + errx(2, "option '--target' requires an argument"); target = argv[i+1]; argv[++i] = NULL; } - else if ( !strcmp(arg, "--help") ) - help(stdout, argv0), exit(0); - else if ( !strcmp(arg, "--version") ) - version(stdout, argv0), exit(0); else - { - fprintf(stderr, "%s: unknown option: %s\n", argv0, arg); - help(stderr, argv0); - exit(1); - } + errx(2, "unknown option: %s", arg); } compact_arguments(&argc, &argv);