[PATCH] command: return 1 on unknown command
Sascha Hauer
s.hauer at pengutronix.de
Thu Nov 1 10:14:21 EDT 2012
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 at 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
More information about the barebox
mailing list