From 822ad01d5db8e530f70d76ac9da0b2730279bfb4 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sun, 11 Oct 2015 11:43:40 -0700 Subject: common/parser.c: Do not conflate error reporting disciplines Run_command() uses 0 to indicate success and negative values to indicate errors, whereas execute_command() uses 0 for success and positive integers to represent error codes. Conflating the two breaks the code that calls run_command and then checks for error code sign to detect problems, so avoid that by doing a very simple transformation on the result of execute_command Signed-off-by: Andrey Smirnov Signed-off-by: Sascha Hauer --- common/parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'common/parser.c') diff --git a/common/parser.c b/common/parser.c index ed414d04ea..2b95aeda16 100644 --- a/common/parser.c +++ b/common/parser.c @@ -253,7 +253,8 @@ int run_command(const char *cmd) continue; } - rc = execute_command(argc, argv); + if (execute_command(argc, argv) != COMMAND_SUCCESS) + rc = -1; } return rc; -- cgit v1.2.3