All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Return error code in case of invalid command line option
@ 2014-09-03 15:29 Vivek Goyal
  2014-09-04  0:38 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Vivek Goyal @ 2014-09-03 15:29 UTC (permalink / raw)
  To: Kexec Mailing List, Simon Horman

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>
---
 kexec/kexec.c |    2 ++
 1 file changed, 2 insertions(+)

Index: kexec-tools/kexec/kexec.c
===================================================================
--- kexec-tools.orig/kexec/kexec.c	2014-08-28 15:36:17.563115135 -0400
+++ kexec-tools/kexec/kexec.c	2014-09-03 11:19:46.505871590 -0400
@@ -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;

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-04  0:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03 15:29 [PATCH] Return error code in case of invalid command line option Vivek Goyal
2014-09-04  0:38 ` Simon Horman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.