From: Ryan Bloom Date: Fri, 12 Jan 2001 00:56:13 +0000 (+0000) Subject: Stop using environment variables to set ONE_PROCESS and NO_DETACH. Now X-Git-Tag: APACHE_2_0_BETA_CANDIDATE_1~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f551be1baaa4838c476af05c0a8ce5cf04ad23a;p=thirdparty%2Fapache%2Fhttpd.git Stop using environment variables to set ONE_PROCESS and NO_DETACH. Now we use the -D command line argument to Apache to configure these options. Submitted by: Greg Stein git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87661 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index c89e4354f32..fa75640c836 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes with Apache 2.0b1 + *) Stop using environment variables to force debug mode or + no detach. We now use the -D command line argument to + specify the correct mode. -DONE_PROCESS and -DNO_DETACH. + [Greg Stein] + *) Change handlers to use hooks. [Ben Laurie] *) Stop returning copies of filenames from both apr_file_t and diff --git a/server/mpm/beos/beos.c b/server/mpm/beos/beos.c index eda7446a3ab..1f49e7c87be 100644 --- a/server/mpm/beos/beos.c +++ b/server/mpm/beos/beos.c @@ -813,8 +813,8 @@ static void beos_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pte static int restart_num = 0; int no_detach = 0; - one_process = !!getenv("ONE_PROCESS"); - no_detach = !!getenv("NO_DETACH"); + one_process = !!ap_exists_config_define("ONE_PROCESS"); + no_detach = !!ap_exists_config_define("NO_DETACH"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index cb572124de9..6abf8c94bf6 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -1127,8 +1127,8 @@ static void dexter_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp static int restart_num = 0; int no_detach = 0; - one_process = !!getenv("ONE_PROCESS"); - no_detach = !!getenv("NO_DETACH"); + one_process = !!ap_exists_config_define("ONE_PROCESS"); + no_detach = !!ap_exists_config_define("NO_DETACH"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c index 8c8d7fc1629..b93a03c7118 100644 --- a/server/mpm/experimental/perchild/perchild.c +++ b/server/mpm/experimental/perchild/perchild.c @@ -1299,8 +1299,8 @@ static void perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *pte int no_detach = 0; int i; - one_process = !!getenv("ONE_PROCESS"); - no_detach = !!getenv("NO_DETACH"); + one_process = !!ap_exists_config_define("ONE_PROCESS"); + no_detach = !!ap_exists_config_define("NO_DETACH"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { diff --git a/server/mpm/mpmt_beos/mpmt_beos.c b/server/mpm/mpmt_beos/mpmt_beos.c index 3f907c2bd4a..dc0747ada2f 100644 --- a/server/mpm/mpmt_beos/mpmt_beos.c +++ b/server/mpm/mpmt_beos/mpmt_beos.c @@ -820,8 +820,8 @@ static void mpmt_beos_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t static int restart_num = 0; int no_detach = 0; - one_process = !!getenv("ONE_PROCESS"); - no_detach = !!getenv("NO_DETACH"); + one_process = !!ap_exists_config_define("ONE_PROCESS"); + no_detach = !!ap_exists_config_define("NO_DETACH"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 131e68fb086..2a31c75d206 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -1162,8 +1162,8 @@ static void mpmt_pthread_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_poo static int restart_num = 0; int no_detach = 0; - one_process = !!getenv("ONE_PROCESS"); - no_detach = !!getenv("NO_DETACH"); + one_process = !!ap_exists_config_define("ONE_PROCESS"); + no_detach = !!ap_exists_config_define("NO_DETACH"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c index 8c8d7fc1629..b93a03c7118 100644 --- a/server/mpm/perchild/perchild.c +++ b/server/mpm/perchild/perchild.c @@ -1299,8 +1299,8 @@ static void perchild_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *pte int no_detach = 0; int i; - one_process = !!getenv("ONE_PROCESS"); - no_detach = !!getenv("NO_DETACH"); + one_process = !!ap_exists_config_define("ONE_PROCESS"); + no_detach = !!ap_exists_config_define("NO_DETACH"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index af40c85b1b4..26b76bb0359 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -1547,7 +1547,8 @@ static void prefork_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptem static int restart_num = 0; int no_detach = 0; - no_detach = !!getenv("NO_DETACH"); + no_detach = !!ap_exists_config_define("NO_DETACH"); + one_process = !!ap_exists_config_define("ONE_PROCESS"); /* sigh, want this only the second time around */ if (restart_num++ == 1) { @@ -1581,7 +1582,6 @@ static void prefork_hooks(void) #ifdef AUX3 (void) set42sig(); #endif - one_process = !!getenv("ONE_PROCESS"); ap_hook_pre_config(prefork_pre_config, NULL, NULL, AP_HOOK_MIDDLE); } diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index 3b181a581a0..8aaccc84862 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -1366,7 +1366,7 @@ int ap_mpm_run(apr_pool_t *_pconf, apr_pool_t *plog, server_rec *s) static void spmt_os2_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp) { - one_process = !!getenv("ONE_PROCESS"); + one_process = !!ap_exists_config_define("ONE_PROCESS"); is_graceful = 0; ap_listen_pre_config(); diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 78e5a407f2b..0bddb56ed82 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -1835,7 +1835,7 @@ void winnt_rewrite_args(process_rec *process) GetVersionEx(&osver); /* AP_PARENT_PID is only valid in the child */ - pid = getenv("AP_PARENT_PID"); + pid = ap_exists_config_define("AP_PARENT_PID"); if (pid) { /* This is the child */ @@ -2028,7 +2028,7 @@ static void winnt_pre_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *pt */ apr_status_t rv; - if (getenv("ONE_PROCESS")) + if (ap_exists_config_define("ONE_PROCESS")) one_process = -1; if (ap_exists_config_define("ONE_PROCESS"))