From 1dec82c3de0c447a82e1da0b27808a798fb1c30e Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Sat, 17 Nov 2018 09:56:33 +0000 Subject: [PATCH] Pass correct end of readiness notification pipe to subprocess. --- src/baseproc-service.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/baseproc-service.cc b/src/baseproc-service.cc index c437185..22a61a2 100644 --- a/src/baseproc-service.cc +++ b/src/baseproc-service.cc @@ -155,16 +155,15 @@ bool base_process_service::start_ps_process(const std::vector &cmd const char * working_dir_c = nullptr; if (! working_dir.empty()) working_dir_c = working_dir.c_str(); run_child_proc(cmd.data(), working_dir_c, logfile, on_console, pipefd[1], control_socket[1], - socket_fd, notify_pipe[0], force_notification_fd, nullptr, run_as_uid, run_as_gid); + socket_fd, notify_pipe[1], force_notification_fd, nullptr, run_as_uid, run_as_gid); } else { // Parent process - bp_sys::close(pipefd[1]); // close the 'other end' fd - if (control_socket[1] != -1) { - bp_sys::close(control_socket[1]); - } pid = forkpid; + bp_sys::close(pipefd[1]); // close the 'other end' fd + if (control_socket[1] != -1) bp_sys::close(control_socket[1]); + if (notify_pipe[1] != -1) bp_sys::close(notify_pipe[1]); notification_fd = notify_pipe[0]; waiting_for_execstat = true; return true; -- 2.25.1