1 --- server/mpm/prefork/prefork.c 2009/01/31 20:53:11 739607
2 +++ server/mpm/prefork/prefork.c 2009/01/31 20:54:55 739608
5 const apr_pollfd_t *pdesc;
7 - /* timeout == -1 == wait forever */
8 - status = apr_pollset_poll(pollset, -1, &numdesc, &pdesc);
9 + /* check for termination first so we don't sleep for a while in
10 + * poll if already signalled
12 + if (one_process && shutdown_pending) {
13 + SAFE_ACCEPT(accept_mutex_off());
17 + /* In graceful stop/restart; drop the mutex
18 + * and terminate the child. */
19 + SAFE_ACCEPT(accept_mutex_off());
20 + clean_child_exit(0);
22 + /* timeout == 10 seconds to avoid a hang at graceful restart/stop
23 + * caused by the closing of sockets by the signal handler
25 + status = apr_pollset_poll(pollset, apr_time_from_sec(10),
27 if (status != APR_SUCCESS) {
28 - if (APR_STATUS_IS_EINTR(status)) {
29 - if (one_process && shutdown_pending) {
33 - /* In graceful stop/restart; drop the mutex
34 - * and terminate the child. */
35 - SAFE_ACCEPT(accept_mutex_off());
36 - clean_child_exit(0);
38 + if (APR_STATUS_IS_TIMEUP(status) ||
39 + APR_STATUS_IS_EINTR(status)) {
42 /* Single Unix documents select as returning errnos