From 88500e81558e2d2d34a1e272cf7000bfc331f72f Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Wed, 8 Dec 2010 14:00:05 -0800 Subject: need to check if process terminated normally before checking return code status. --- src/cli_new.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli_new.c b/src/cli_new.c index b4349b2..f88e5c3 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -2667,7 +2667,10 @@ system_out(const char *cmd, const char *prepend_msg, boolean format) int status; wait(&status); close(cp[0]); - return WEXITSTATUS(status); + if (WIFEXITED(status)) { + return WEXITSTATUS(status); + } + return 1; } } -- cgit v1.2.3