From 1610c8d4f5210be381e19ce855e582b97c98ab9c Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 16 Jul 2000 07:12:42 +0000 Subject: [PATCH] OS/2: Put back creation of listeners in main thread in spmt_os2 MPM. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85856 13f79535-47bb-0310-9956-ffa450edef68 --- include/ap_listen.h | 2 +- server/listen.c | 2 +- server/mpm/spmt_os2/spmt_os2.c | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/ap_listen.h b/include/ap_listen.h index c5a016871d..2b10ddbd52 100644 --- a/include/ap_listen.h +++ b/include/ap_listen.h @@ -73,7 +73,7 @@ struct ap_listen_rec { extern ap_listen_rec *ap_listeners; void ap_listen_pre_config(void); -#if !defined(WIN32) && !defined(PREFORK_MPM) +#if !defined(WIN32) && !defined(PREFORK_MPM) && !defined(SPMT_OS2_MPM) int ap_setup_listeners(server_rec *s); #else int ap_listen_open(process_rec *process, unsigned port); diff --git a/server/listen.c b/server/listen.c index 918931e156..00fdfca1e7 100644 --- a/server/listen.c +++ b/server/listen.c @@ -202,7 +202,7 @@ static void alloc_listener(process_rec *process, char *addr, unsigned int port) ap_listeners = new; } -#if !defined(WIN32) && !defined(PREFORK_MPM) +#if !defined(WIN32) && !defined(PREFORK_MPM) && !defined(SPMT_OS2_MPM) static #endif int ap_listen_open(process_rec *process, unsigned port) diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index 61e907f565..978b6be274 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -1188,6 +1188,12 @@ int ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s) ap_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.50.1