summaryrefslogtreecommitdiffstats
path: root/lib/exec.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/exec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/exec.c b/lib/exec.c
index 9b1c8f4..8939375 100644
--- a/lib/exec.c
+++ b/lib/exec.c
@@ -36,8 +36,13 @@ int cmd_exec(const char *cmd, char **argv, bool do_fork,
}
}
- if (setup && setup(arg))
+ if (setup && setup(arg)) {
+ if (do_fork) {
+ /* In child, nothing to do */
+ _exit(1);
+ }
return -1;
+ }
if (execvp(cmd, argv) < 0)
fprintf(stderr, "exec of \"%s\" failed: %s\n",