From 73f7934fd46d15a07592d18671acd619b8c05219 Mon Sep 17 00:00:00 2001 From: Bradley Nicholes Date: Wed, 24 Jul 2002 15:17:56 +0000 Subject: [PATCH] Hold the Apache screen open on NetWare if exit() is called for any reason during initialization and configuration of the main Apache process. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96172 13f79535-47bb-0310-9956-ffa450edef68 --- os/netware/os.h | 4 +++- server/mpm/netware/mpm_netware.c | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/os/netware/os.h b/os/netware/os.h index a38d1c4a1f..b40d9c9833 100644 --- a/os/netware/os.h +++ b/os/netware/os.h @@ -65,12 +65,14 @@ #include +extern int hold_screen_on_exit; /* Indicates whether the screen should be held open on exit*/ + #define CASE_BLIND_FILESYSTEM #define NO_WRITEV #define APACHE_MPM_DIR "server/mpm/netware" /* generated on unix */ #define getpid NXThreadGetId -#define exit(s) if(s){pressanykey();apr_terminate();}exit(s); +#define exit(s) if(s||hold_screen_on_exit){pressanykey();apr_terminate();}exit(s); #endif /* ! APACHE_OS_H */ diff --git a/server/mpm/netware/mpm_netware.c b/server/mpm/netware/mpm_netware.c index 0eadf3ecdb..56f81ea405 100644 --- a/server/mpm/netware/mpm_netware.c +++ b/server/mpm/netware/mpm_netware.c @@ -164,6 +164,8 @@ server_rec *ap_server_conf; /* *Non*-shared http_main globals... */ +int hold_screen_on_exit = 0; /* Indicates whether the screen should be held open */ + static fd_set listenfds; static int listenmaxfd; @@ -907,6 +909,9 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) startup_workers(ap_threads_to_start); + /* Allow the Apache screen to be closed normally on exit()*/ + hold_screen_on_exit = 0; + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, ap_server_conf, "%s configured -- resuming normal operations", ap_get_server_version()); @@ -1009,6 +1014,9 @@ void netware_rewrite_args(process_rec *process) atexit (mpm_term); InstallConsoleHandler(); + /* Make sure to hold the Apache screen open if exit() is called */ + hold_screen_on_exit = 1; + /* Rewrite process->argv[]; * * add default -d serverroot from the path of this executable -- 2.50.1