From c3379e5fef0edc9724ef5fb68edb0fdf96157854 Mon Sep 17 00:00:00 2001 From: Ryan Bloom Date: Mon, 10 Jul 2000 23:12:10 +0000 Subject: [PATCH] Make the spmt_os2 MPM use the new setup_listeners API. This should work, but I make no garauntees. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85812 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/spmt_os2/spmt_os2.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index 7425b3ca06..65650e3b9a 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -727,6 +727,7 @@ static void child_main(void *child_num_arg) ap_pollfd_t *listen_poll; ap_socket_t *csd = NULL; int nsds, rv; + int num_listensocks; /* Disable the restart signal handlers and enable the just_die stuff. * Note that since restart() just notes that a restart has been @@ -748,8 +749,15 @@ static void child_main(void *child_num_arg) THREAD_GLOBAL(pchild) = pchild; ap_create_pool(&ptrans, pchild); - if (ap_setup_listeners(pchild, &listen_poll)) { - clean_child_exit(1); + if ((num_listensocks = ap_setup_listeners(s)) < 1) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, 0, s, + "no listening sockets available, shutting down"); + return -1; + } + + ap_setup_poll(&listen_poll, num_listensocks+1, pchild); + for (lr = ap_listeners; lr; lr = lr->next) { + ap_add_poll_socket(*listen_poll, lr->sd, APR_POLLIN); } /* needs to be done before we switch UIDs so we have permissions */ @@ -1167,12 +1175,6 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s) server_conf = s; ap_log_pid(pconf, ap_pid_fname); - if ((status = ap_listen_open(s->process, s->port)) != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, status, s, - "no listening sockets available, shutting down"); - return -1; - } - SAFE_ACCEPT(accept_mutex_init(pconf)); if (!is_graceful) { -- 2.40.0