From: Rainer Jung Date: Wed, 21 Jan 2009 21:52:28 +0000 (+0000) Subject: Fix two small glitches in r730828 (Win9x code X-Git-Tag: 2.3.2~137 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91f503db6bc66355b73ccf90445906b2277b6500;p=apache Fix two small glitches in r730828 (Win9x code removal in mpm_winnt). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@736427 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index 129a0679bb..52884fb468 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -1093,6 +1093,8 @@ void child_main(apr_pool_t *pconf) "Child %d: All worker threads have exited.", my_pid); apr_thread_mutex_destroy(child_lock); + apr_thread_mutex_destroy(qlock); + CloseHandle(qwait_event); apr_pool_destroy(pchild); CloseHandle(exit_event); diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 45ac052b83..1422041fa4 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -432,8 +432,6 @@ void get_listeners_from_parent(server_rec *s) DWORD BytesRead; int lcnt = 0; SOCKET nsd; - HANDLE hProcess = GetCurrentProcess(); - HANDLE dup; /* Set up a default listener if necessary */ if (ap_listeners == NULL) { @@ -466,12 +464,10 @@ void get_listeners_from_parent(server_rec *s) exit(APEXIT_CHILDINIT); } - if (DuplicateHandle(hProcess, (HANDLE) nsd, hProcess, &dup, - 0, FALSE, DUPLICATE_SAME_ACCESS)) { - closesocket(nsd); - nsd = (SOCKET) dup; + if (!SetHandleInformation((HANDLE)nsd, HANDLE_FLAG_INHERIT, 0)) { + ap_log_error(APLOG_MARK, APLOG_ERR, apr_get_os_error(), ap_server_conf, + "set_listeners_noninheritable: SetHandleInformation failed."); } - apr_os_sock_put(&lr->sd, &nsd, s->process->pool); }