X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fdetect-virt%2Fdetect-virt.c;h=2f8b0ebbbccca01307a2e43719496f69d7f4d7ab;hp=a83fb3ced52059501ab6beae0c08edbfc6f99eb8;hb=051dfe8708e394a64e8ef6c281228763481ad32c;hpb=dce818b390a857a11f7dd634684500675cf79833 diff --git a/src/detect-virt/detect-virt.c b/src/detect-virt/detect-virt.c index a83fb3ced..2f8b0ebbb 100644 --- a/src/detect-virt/detect-virt.c +++ b/src/detect-virt/detect-virt.c @@ -61,8 +61,8 @@ static int parse_argv(int argc, char *argv[]) { { "version", no_argument, NULL, ARG_VERSION }, { "container", no_argument, NULL, 'c' }, { "vm", optional_argument, NULL, 'v' }, - { "quiet", required_argument, NULL, 'q' }, - { NULL, 0, NULL, 0 } + { "quiet", no_argument, NULL, 'q' }, + {} }; int c; @@ -75,12 +75,10 @@ static int parse_argv(int argc, char *argv[]) { switch (c) { case 'h': - help(); - return 0; + return help(); case ARG_VERSION: puts(PACKAGE_STRING); - puts(DISTRIBUTION); puts(SYSTEMD_FEATURES); return 0; @@ -100,8 +98,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - log_error("Unknown option code %c", c); - return -EINVAL; + assert_not_reached("Unhandled option"); } } @@ -115,7 +112,8 @@ static int parse_argv(int argc, char *argv[]) { int main(int argc, char *argv[]) { const char *id = NULL; - int retval, r; + int retval = EXIT_SUCCESS; + int r; /* This is mostly intended to be used for scripts which want * to detect whether we are being run in a virtualized