httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: [PATCH] properly set the parent pid on shutdown
Date Fri, 26 May 2006 18:48:05 GMT
+1 on visual review.  Anyone have a win9x install handy to verify
that this works?  Sorry, none of my multiboots still boot 9x.

Davi Arnaut wrote:
> Hi,
> 
> On WIN9X machines, before signaling the parent process in
> ap_signal_parent() we ought to set the proper parent pid
> retrieved by GetWindowThreadProcessId(). Otherwise, the
> event will be signaled without being properly opened because
> the parent  pid will remain the same as the calling process pid.
> 
> With this patch it's possible to stop the httpd daemon with
> the standart -k stop signal on WIN9X.
> 
> --
> Davi Arnaut
> 
> Index: server/mpm/winnt/service.c
> ===================================================================
> --- server/mpm/winnt/service.c	(revision 409410)
> +++ server/mpm/winnt/service.c	(working copy)
> @@ -35,6 +35,7 @@
>  #undef _WINUSER_
>  #include <winuser.h>
>  
> +extern DWORD parent_pid;
>  static char *mpm_service_name = NULL;
>  static char *mpm_display_name = NULL;
>  
> @@ -1289,8 +1290,10 @@
>           * provided the class is ApacheWin95ServiceMonitor
>           */
>          hwnd = FindWindow("ApacheWin95ServiceMonitor", mpm_service_name);
> -        if (hwnd && GetWindowThreadProcessId(hwnd, &service_pid))
> +        if (hwnd && GetWindowThreadProcessId(hwnd, &service_pid)) {
> +            parent_pid = service_pid;
>              globdat.ssStatus.dwCurrentState = SERVICE_RUNNING;
> +        }
>          else
>          {
>              globdat.ssStatus.dwCurrentState = SERVICE_STOPPED;
> Index: server/mpm/winnt/mpm_winnt.c
> ===================================================================
> --- server/mpm/winnt/mpm_winnt.c	(revision 409410)
> +++ server/mpm/winnt/mpm_winnt.c	(working copy)
> @@ -57,7 +57,7 @@
>  
>  OSVERSIONINFO osver; /* VER_PLATFORM_WIN32_NT */
>  
> -static DWORD parent_pid;
> +DWORD parent_pid;
>  DWORD my_pid;
>  
>  int ap_threads_per_child = 0;
> 
> 
> 


Mime
View raw message