]> granicus.if.org Git - apache/commitdiff
Hold the Apache screen open on NetWare if exit() is called for any reason
authorBradley Nicholes <bnicholes@apache.org>
Wed, 24 Jul 2002 15:17:56 +0000 (15:17 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 24 Jul 2002 15:17:56 +0000 (15:17 +0000)
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
server/mpm/netware/mpm_netware.c

index a38d1c4a1f88c2dc2bc941ecb34429152b5cdcaa..b40d9c9833f261a271638420e05fce00818381b3 100644 (file)
 
 #include <screen.h>
 
+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 */
index 0eadf3ecdb0f6152d934df512260e73bdf434c25..56f81ea405c5326e62a95d6854634ce8accd2099 100644 (file)
@@ -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