]> granicus.if.org Git - apache/commitdiff
Don't hold the Apache screen open when it exits with an error if all of the error
authorBradley Nicholes <bnicholes@apache.org>
Wed, 13 Nov 2002 21:14:02 +0000 (21:14 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 13 Nov 2002 21:14:02 +0000 (21:14 +0000)
messages are going to a file anyway.  In other words, don't hold the screen
open if the -E <filename> command line parameter is used.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97507 13f79535-47bb-0310-9956-ffa450edef68

build/nw_export.inc
os/netware/os.h
server/mpm/netware/mpm_netware.c

index cb3e3c4776e57081fcc23bfd213bb43cef6f2427..77522ee0c2d156f5eeacfaaa45b5aacc2c8cb399 100644 (file)
@@ -13,6 +13,7 @@
 #define AP_CORE_DECLARE_NONSTD  AP_CORE_DECLARE_NONSTD
 #define AP_DECLARE_HOOK         AP_DECLARE_HOOK
 #define AP_DECLARE_DATA         AP_DECLARE_DATA
+#undef  APACHE_OS_H
 
 #include "httpd.h"
 
index beec1b6cc4619bdbe7fae8ea31cec59bb1a73ab0..c60c239269c6f55aa8b83620abda6728c8a8be5a 100644 (file)
@@ -65,7 +65,7 @@
 
 #include <screen.h>
 
-extern int hold_screen_on_exit; /* Indicates whether the screen should be held open on exit*/
+AP_DECLARE_DATA extern int hold_screen_on_exit; /* Indicates whether the screen should be held open on exit*/
 
 #define CASE_BLIND_FILESYSTEM
 #define NO_WRITEV
@@ -73,6 +73,10 @@ extern int hold_screen_on_exit; /* Indicates whether the screen should be held o
 #define APACHE_MPM_DIR  "server/mpm/netware" /* generated on unix */
 
 #define getpid NXThreadGetId
-#define exit(s) {if(s||hold_screen_on_exit){pressanykey();}apr_terminate();exit(s);}
+
+/* Hold the screen open if there is an exit code and the hold_screen_on_exit flag >= 0 or the
+   hold_screen_on_exit > 0.  If the hold_screen_on_exit flag is < 0 then close the screen no 
+   matter what the exit code is. */
+#define exit(s) {if((s||hold_screen_on_exit)&&(hold_screen_on_exit>=0)){pressanykey();}apr_terminate();exit(s);}
 
 #endif   /* ! APACHE_OS_H */
index a911909bbdef1a510ec4c33806bd5ae85b373a0c..6bfff25532013a9102f9b3f5b532b0840335f7cc 100644 (file)
@@ -1054,6 +1054,9 @@ void netware_rewrite_args(process_rec *process)
             apr_getopt_init(&opt, process->pool, process->argc, (char**) process->argv);
             while (apr_getopt(opt, AP_SERVER_BASEARGS, optbuf + 1, &opt_arg) == APR_SUCCESS) {
                 switch (optbuf[1]) {
+                               case 'E':
+                                       /* Don't need to hold the screen open if the output is going to a file */
+                                       hold_screen_on_exit = -1;
                 default:
                     *(const char **)apr_array_push(mpm_new_argv) =
                         apr_pstrdup(process->pool, optbuf);