diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2023-04-28 22:34:42 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2023-05-03 23:11:35 -0400 |
commit | b5d4f86fe484fd5a8e14dfcc6d97d976f89e57a7 (patch) | |
tree | a1ec2f6267451256956052a3663f0d5e042f3a77 /src | |
parent | 0d0f7852302af38ea1a1f764e206e75e1201ae07 (diff) | |
download | lighttpd-git-b5d4f86fe484fd5a8e14dfcc6d97d976f89e57a7.tar.gz |
[core] return pid_t from fdevent_waitpid()
Diffstat (limited to 'src')
-rw-r--r-- | src/fdevent.c | 4 | ||||
-rw-r--r-- | src/fdevent.h | 4 | ||||
-rw-r--r-- | src/fdevent_win32.c | 4 | ||||
-rw-r--r-- | src/gw_backend.c | 3 |
4 files changed, 8 insertions, 7 deletions
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; |