summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/run.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src/run.c')
-rw-r--r--libglusterfs/src/run.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libglusterfs/src/run.c b/libglusterfs/src/run.c
index 7c237b35fa0..17da3ad1201 100644
--- a/libglusterfs/src/run.c
+++ b/libglusterfs/src/run.c
@@ -338,13 +338,13 @@ int
runner_end_reuse (runner_t *runner)
{
int i = 0;
- int ret = -1;
+ int ret = 1;
int chstat = 0;
if (runner->chpid > 0) {
if (waitpid (runner->chpid, &chstat, 0) == runner->chpid) {
if (WIFEXITED(chstat)) {
- ret = -WEXITSTATUS(chstat);
+ ret = WEXITSTATUS(chstat);
} else {
ret = chstat;
}
@@ -358,7 +358,7 @@ runner_end_reuse (runner_t *runner)
}
}
- return ret;
+ return -ret;
}
int
@@ -387,8 +387,12 @@ runner_run_generic (runner_t *runner, int (*rfin)(runner_t *runner))
int ret = 0;
ret = runner_start (runner);
+ if (ret)
+ goto out;
+ ret = rfin (runner);
- return -(rfin (runner) || ret);
+out:
+ return ret;
}
int