From b5d4f86fe484fd5a8e14dfcc6d97d976f89e57a7 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Fri, 28 Apr 2023 22:34:42 -0400 Subject: [core] return pid_t from fdevent_waitpid() --- src/fdevent.c | 4 ++-- src/fdevent.h | 4 ++-- src/fdevent_win32.c | 4 ++-- src/gw_backend.c | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/fdevent.c b/src/fdevent.c index 6fde8d97..c3d70340 100644 --- a/src/fdevent.c +++ b/src/fdevent.c @@ -601,14 +601,14 @@ int fdevent_kill (pid_t pid, int sig) { #include "sys-wait.h" -int fdevent_waitpid(pid_t pid, int * const status, int nb) { +pid_t fdevent_waitpid(pid_t pid, int * const status, int nb) { const int flags = nb ? WNOHANG : 0; pid_t rv; do { rv = waitpid(pid, status, flags); } while (-1 == rv && errno == EINTR); return rv; } -int fdevent_waitpid_intr(pid_t pid, int * const status) { +pid_t fdevent_waitpid_intr(pid_t pid, int * const status) { return waitpid(pid, status, 0); } diff --git a/src/fdevent.h b/src/fdevent.h index 9364eb4f..072ab5ac 100644 --- a/src/fdevent.h +++ b/src/fdevent.h @@ -116,8 +116,8 @@ int fdevent_open_dirname(char *path, int symlinks); int fdevent_set_stdin_stdout_stderr(int fdin, int fdout, int fderr); pid_t fdevent_fork_execve(const char *name, char *argv[], char *envp[], int fdin, int fdout, int fderr, int dfd); #endif -int fdevent_waitpid(pid_t pid, int *status, int nb); -int fdevent_waitpid_intr(pid_t pid, int *status); +pid_t fdevent_waitpid(pid_t pid, int *status, int nb); +pid_t fdevent_waitpid_intr(pid_t pid, int *status); int fdevent_kill(pid_t pid, int sig); #ifdef _WIN32 diff --git a/src/fdevent_win32.c b/src/fdevent_win32.c index da69433d..2ed631e7 100644 --- a/src/fdevent_win32.c +++ b/src/fdevent_win32.c @@ -404,7 +404,7 @@ int fdevent_kill (pid_t pid, int sig) } -int fdevent_waitpid (pid_t pid, int * const status, int nb) +pid_t fdevent_waitpid (pid_t pid, int * const status, int nb) { #if 0 @@ -492,7 +492,7 @@ int fdevent_waitpid (pid_t pid, int * const status, int nb) } -int fdevent_waitpid_intr (pid_t pid, int * const status) +pid_t fdevent_waitpid_intr (pid_t pid, int * const status) { return fdevent_waitpid(pid, status, 0); } diff --git a/src/gw_backend.c b/src/gw_backend.c index 617cf89d..8efbf47d 100644 --- a/src/gw_backend.c +++ b/src/gw_backend.c @@ -383,7 +383,8 @@ static void gw_proc_waitpid_log(const gw_host * const host, const gw_proc * cons } static int gw_proc_waitpid(gw_host *host, gw_proc *proc, log_error_st *errh) { - int rc, status; + pid_t rc; + int status; if (!proc->is_local) return 0; if (proc->pid <= 0) return 0; -- cgit v1.2.1