From afad21917584e9b452ba33ce3485edde5615b859 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 28 Nov 2017 12:00:24 +0300 Subject: Fixed "changing binary" when reaper is not init. On some systems, it's possible that reaper of orphaned processes is set to something other than "init" process. On such systems, the changing binary procedure did not work. The fix is to check if PPID has changed, instead of assuming it's always 1 for orphaned processes. --- src/os/win32/ngx_process.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/os/win32/ngx_process.h') diff --git a/src/os/win32/ngx_process.h b/src/os/win32/ngx_process.h index a6a5aa29f..7ec4cd92c 100644 --- a/src/os/win32/ngx_process.h +++ b/src/os/win32/ngx_process.h @@ -14,6 +14,7 @@ typedef DWORD ngx_pid_t; #define ngx_getpid GetCurrentProcessId +#define ngx_getppid() 0 #define ngx_log_pid ngx_pid @@ -73,6 +74,7 @@ extern ngx_int_t ngx_last_process; extern ngx_process_t ngx_processes[NGX_MAX_PROCESSES]; extern ngx_pid_t ngx_pid; +extern ngx_pid_t ngx_parent; #endif /* _NGX_PROCESS_H_INCLUDED_ */ -- cgit