summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/run.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libglusterfs/src/run.c b/libglusterfs/src/run.c
index 6018a58ad5f..7c237b35fa0 100644
--- a/libglusterfs/src/run.c
+++ b/libglusterfs/src/run.c
@@ -342,8 +342,13 @@ runner_end_reuse (runner_t *runner)
int chstat = 0;
if (runner->chpid > 0) {
- if (waitpid (runner->chpid, &chstat, 0) == runner->chpid)
- ret = chstat;
+ if (waitpid (runner->chpid, &chstat, 0) == runner->chpid) {
+ if (WIFEXITED(chstat)) {
+ ret = -WEXITSTATUS(chstat);
+ } else {
+ ret = chstat;
+ }
+ }
}
for (i = 0; i < 3; i++) {