From 0de2a457c06d0e7600a1e37446ac1e2664712b70 Mon Sep 17 00:00:00 2001 From: Guenter Knauf Date: Wed, 20 Oct 2010 10:57:28 +0000 Subject: [PATCH] Some minor fixes to provide protos and build with Watcom. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1025492 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/winnt/child.c | 2 ++ server/mpm/winnt/mpm_winnt.c | 25 ++++++++++++++----------- server/mpm/winnt/service.c | 3 ++- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index dd3a15d1dc..ba52526276 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -41,6 +41,8 @@ #include "apr_buckets.h" #include "scoreboard.h" +#include + #ifdef __MINGW32__ #include #endif diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 197b3c77b7..81e7dee1fd 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -30,6 +30,7 @@ #include "apr_shm.h" #include "apr_thread_mutex.h" #include "ap_mpm.h" +#include "apr_general.h" #include "ap_config.h" #include "ap_listen.h" #include "mpm_default.h" @@ -39,6 +40,10 @@ #include "apr_atomic.h" #include "scoreboard.h" +#ifdef __WATCOMC__ +#define _environ environ +#endif + /* scoreboard.c does the heavy lifting; all we do is create the child * score by moving a handle down the pipe into the child's stdin. */ @@ -51,8 +56,6 @@ static volatile ap_generation_t my_generation=0; static HANDLE shutdown_event; /* used to signal the parent to shutdown */ static HANDLE restart_event; /* used to signal the parent to restart */ -static char ap_coredump_dir[MAX_STRING_LEN]; - static int one_process = 0; static char const* signal_arg = NULL; @@ -956,7 +959,7 @@ static apr_status_t service_set = SERVICE_UNSET; static apr_status_t service_to_start_success; static int inst_argc; static const char * const *inst_argv; -static char *service_name = NULL; +static const char *service_name = NULL; void winnt_rewrite_args(process_rec *process) { @@ -979,7 +982,7 @@ void winnt_rewrite_args(process_rec *process) char *def_server_root; char *binpath; char optbuf[3]; - const char *optarg; + const char *opt_arg; int fixed_args; char *pid; apr_getopt_t *opt; @@ -1109,10 +1112,10 @@ void winnt_rewrite_args(process_rec *process) optbuf[0] = '-'; optbuf[2] = '\0'; - apr_getopt_init(&opt, process->pool, process->argc, (char**) process->argv); + apr_getopt_init(&opt, process->pool, process->argc, process->argv); opt->errfn = NULL; while ((rv = apr_getopt(opt, "wn:k:" AP_SERVER_BASEARGS, - optbuf + 1, &optarg)) == APR_SUCCESS) { + optbuf + 1, &opt_arg)) == APR_SUCCESS) { switch (optbuf[1]) { /* Shortcuts; include the -w option to hold the window open on error. @@ -1125,11 +1128,11 @@ void winnt_rewrite_args(process_rec *process) case 'n': service_set = mpm_service_set_name(process->pool, &service_name, - optarg); + opt_arg); break; case 'k': - signal_arg = optarg; + signal_arg = opt_arg; break; case 'E': @@ -1139,8 +1142,8 @@ void winnt_rewrite_args(process_rec *process) *(const char **)apr_array_push(mpm_new_argv) = apr_pstrdup(process->pool, optbuf); - if (optarg) { - *(const char **)apr_array_push(mpm_new_argv) = optarg; + if (opt_arg) { + *(const char **)apr_array_push(mpm_new_argv) = opt_arg; } break; } @@ -1190,7 +1193,7 @@ void winnt_rewrite_args(process_rec *process) * after logging begins, and the failure can land in the log. */ if (!errout) { - mpm_nt_eventlog_stderr_open(service_name, process->pool); + mpm_nt_eventlog_stderr_open((char*)service_name, process->pool); } service_to_start_success = mpm_service_to_start(&service_name, process->pool); diff --git a/server/mpm/winnt/service.c b/server/mpm/winnt/service.c index a4ffd0400f..8c19fcf595 100644 --- a/server/mpm/winnt/service.c +++ b/server/mpm/winnt/service.c @@ -33,6 +33,7 @@ #endif #undef _WINUSER_ #include +#include APLOG_USE_MODULE(mpm_winnt); @@ -821,7 +822,7 @@ apr_status_t mpm_service_start(apr_pool_t *ptemp, int argc, const char * const * argv) { apr_status_t rv; - char **start_argv; + const char **start_argv; SC_HANDLE schService; SC_HANDLE schSCManager; -- 2.50.1