From 9fdfe4423615d8e7d92b1057f48db9ed10bd6f4d Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Tue, 26 Sep 2017 08:16:36 -0500 Subject: [PATCH] Fix type of pid_status variable We had pid_status defined as a pid_t instance, which was fine since on most platforms pid_t is an alias for int. However, that is not universally the case and waitpid takes an int *, not a pid_t *. --- src/exec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exec.cpp b/src/exec.cpp index 209f7ab0f..a390cfcb3 100644 --- a/src/exec.cpp +++ b/src/exec.cpp @@ -1115,8 +1115,8 @@ void exec_job(parser_t &parser, job_t *j) { // child_set_group() at this point. but we only need to call set_child_group for the // first process in the group. If needs_keepalive is set, this has already been called // for the keepalive process. - pid_t pid_status{}; int result; + int pid_status; while ((result = waitpid(p->pid, &pid_status, WUNTRACED)) == -1 && errno == EINTR) { // This could be a superfluous interrupt or Ctrl+C at the terminal In all cases, it // is OK to retry since the forking code above is specifically designed to never,