mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] command: return 1 on unknown command
@ 2012-11-01 14:14 Sascha Hauer
  0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2012-11-01 14:14 UTC (permalink / raw)
  To: barebox

hush now prints the error value if a command returns a value < 0,
so do not return -1 (EPERM) when we encounter an unknown command.
Instead, return 1 so that hush is quiet.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/command.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/command.c b/common/command.c
index 873b3ff..7f2b777 100644
--- a/common/command.c
+++ b/common/command.c
@@ -85,7 +85,7 @@ int execute_command(int argc, char **argv)
 #else
 		printf ("Unknown command '%s'\n", argv[0]);
 #endif
-		ret = -1;	/* give up after bad command */
+		ret = 1;	/* give up after bad command */
 	}
 
 	getopt_context_restore(&gc);
-- 
1.7.10.4


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-01 14:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-01 14:14 [PATCH] command: return 1 on unknown command Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox