diff options
author | Michael Larson <mike@vyatta.com> | 2010-12-08 14:00:05 -0800 |
---|---|---|
committer | Michael Larson <mike@vyatta.com> | 2010-12-08 14:00:05 -0800 |
commit | 88500e81558e2d2d34a1e272cf7000bfc331f72f (patch) | |
tree | 9e5ce157f0df256363a726bf066ae703565e4cb4 | |
parent | b68adc147ba04902bccf4477c231976b8450220b (diff) | |
download | vyatta-cfg-88500e81558e2d2d34a1e272cf7000bfc331f72f.tar.gz vyatta-cfg-88500e81558e2d2d34a1e272cf7000bfc331f72f.zip |
need to check if process terminated normally before checking return code status.
-rw-r--r-- | src/cli_new.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } } |