summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2014-09-03 11:29:17 -0400
committerSimon Horman <horms@verge.net.au>2014-09-04 09:37:46 +0900
commit551c9affee189a9a240d5ba673e6fe5fe3a9a7b9 (patch)
treef3cb1bbaf87478b5e21494aa5f6d7dceff4dcded
parent45b33eb2e70cd44f41abf1058a92659cb4315011 (diff)
downloadkexec-tools-551c9affee189a9a240d5ba673e6fe5fe3a9a7b9.tar.gz
Return error code in case of invalid command line option
Currently kexec returns success even if an invalid command line option is encountered. Kexec currently prints usage message and then returns 0. That's not right. It is an error and error code 1 should be returned. Due to this wrapper script thinks that kdump succeeded but that's not the case. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/kexec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c
index 7e7b604..a5e78c6 100644
--- a/kexec/kexec.c
+++ b/kexec/kexec.c
@@ -1209,6 +1209,8 @@ int main(int argc, char *argv[])
options, 0)) != -1) {
switch(opt) {
case '?':
+ usage();
+ return 1;
case OPT_HELP:
usage();
return 0;