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=bd3ee452c12e67e1696423cc5fd3bc84160de189;hb=051dfe8708e394a64e8ef6c281228763481ad32c;hpb=f274ece0f76b5709408821e317e87aef76123db6 diff --git a/src/detect-virt/detect-virt.c b/src/detect-virt/detect-virt.c index bd3ee452c..2f8b0ebbb 100644 --- a/src/detect-virt/detect-virt.c +++ b/src/detect-virt/detect-virt.c @@ -62,7 +62,7 @@ static int parse_argv(int argc, char *argv[]) { { "container", no_argument, NULL, 'c' }, { "vm", optional_argument, NULL, 'v' }, { "quiet", no_argument, NULL, 'q' }, - { NULL, 0, NULL, 0 } + {} }; int c; @@ -75,8 +75,7 @@ static int parse_argv(int argc, char *argv[]) { switch (c) { case 'h': - help(); - return 0; + return help(); case ARG_VERSION: puts(PACKAGE_STRING); @@ -99,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"); } } @@ -114,8 +112,8 @@ static int parse_argv(int argc, char *argv[]) { int main(int argc, char *argv[]) { const char *id = NULL; - int 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