aboutsummaryrefslogtreecommitdiff
path: root/src/Program.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Program.cpp')
-rw-r--r--src/Program.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Program.cpp b/src/Program.cpp
index c0e0eca..5daf25c 100644
--- a/src/Program.cpp
+++ b/src/Program.cpp
@@ -96,9 +96,9 @@ int exec_program_pipe(const char **args, ReadProgram *read_program) {
pid_t parent_pid = getpid();
- pid_t pid = fork();
+ pid_t pid = vfork();
if(pid == -1) {
- perror("Failed to fork");
+ perror("Failed to vfork");
close(fd[READ_END]);
close(fd[WRITE_END]);
return -3;
@@ -238,10 +238,10 @@ int exec_program_async(const char **args, pid_t *result_process_id) {
pid_t parent_pid = getpid();
- pid_t pid = fork();
+ pid_t pid = vfork();
if(pid == -1) {
int err = errno;
- perror("Failed to fork");
+ perror("Failed to vfork");
return -err;
} else if(pid == 0) { /* child */
if(result_process_id) {
@@ -262,7 +262,7 @@ int exec_program_async(const char **args, pid_t *result_process_id) {
signal(SIGHUP, SIG_IGN);
// Daemonize child to make the parent the init process which will reap the zombie child
- pid_t second_child = fork();
+ pid_t second_child = vfork();
if(second_child == 0) { // child
execvp(args[0], (char* const*)args);
perror("execvp");