summaryrefslogtreecommitdiff
path: root/src/cli_new.c
diff options
context:
space:
mode:
authorMichael Larson <slioch@slioch.vyatta.com>2010-07-19 17:03:13 -0700
committerMichael Larson <slioch@slioch.vyatta.com>2010-07-19 17:03:13 -0700
commitf49b175a15eeaaf7312321bfe4d6a51f7a790b89 (patch)
tree32b84c885dbb608abc0c189a8909bdb21748fbf9 /src/cli_new.c
parentcc08308935ad04f7cb625562d6f525797bd0c3ac (diff)
downloadvyatta-cfg-f49b175a15eeaaf7312321bfe4d6a51f7a790b89.tar.gz
vyatta-cfg-f49b175a15eeaaf7312321bfe4d6a51f7a790b89.zip
modified handling of status return codes for child process.
Diffstat (limited to 'src/cli_new.c')
-rw-r--r--src/cli_new.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/cli_new.c b/src/cli_new.c
index ae12622..4884d9e 100644
--- a/src/cli_new.c
+++ b/src/cli_new.c
@@ -2457,19 +2457,11 @@ system_out(const char *cmd, const char **outbuf)
int ret = system(cmd);
close( cp[1]);
-
- //doing this to match old system out command, although this doesn't
- //appear to be entirely correct in the interpretation of the error codes from system
- if (ret > 255) {
- ret = -1;
- }
-
exit(ret);
}
else {
//parent
char buf[1025];
- int size = 0;
memset(buf,'\0',1025);
close(cp[1]);
if (read(cp[0], &buf, 1024) > 0) {
@@ -2480,11 +2472,8 @@ system_out(const char *cmd, const char **outbuf)
int status;
wait(&status);
close(cp[0]);
- if (WIFEXITED(status) == TRUE) {
- return WEXITSTATUS(status);
- }
+ return WEXITSTATUS(status);
}
- return 0;
}