diff options
Diffstat (limited to 'libglusterfs')
-rw-r--r-- | libglusterfs/src/common-utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 022fdf35537..75476a0291e 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -1510,11 +1510,16 @@ gf_system (const char *command) /* Code will not come here at all */ gf_log ("", GF_LOG_ERROR, "execv of (%s) failed", command); + + kill (getpid(), SIGKILL); } if (pid > 0) { /* Current, ie, parent process */ pid = waitpid (pid, &status, 0); - ret = status; + if (WIFEXITED(status) && WEXITSTATUS(status) == EXIT_SUCCESS) + ret = 0; + else + ret = -1; } out: if (dupcmd) |