#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"
#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
#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 */
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);