summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/run.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libglusterfs/src/run.c b/libglusterfs/src/run.c
index 44ef2f0d739..0dbf33b9d96 100644
--- a/libglusterfs/src/run.c
+++ b/libglusterfs/src/run.c
@@ -364,9 +364,11 @@ runner_end (runner_t *runner)
ret = runner_end_reuse (runner);
- for (p = runner->argv; *p; p++)
- GF_FREE (*p);
- GF_FREE (runner->argv);
+ if (runner->argv) {
+ for (p = runner->argv; *p; p++)
+ GF_FREE (*p);
+ GF_FREE (runner->argv);
+ }
for (i = 0; i < 3; i++)
close (runner->chfd[i]);
@@ -379,10 +381,8 @@ runner_run_generic (runner_t *runner, int (*rfin)(runner_t *runner))
int ret = 0;
ret = runner_start (runner);
- if (ret != 0)
- return -1;
- return rfin (runner) ? -1 : 0;
+ return -(rfin (runner) || ret);
}
int