diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2002-07-01 20:24:54 +0200 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2002-07-01 20:24:54 +0200 |
commit | da73839710e28fb26136de5c538a41205c8a2f91 (patch) | |
tree | 7c07fcaf492efb99898f093c658e77b69b24fd71 /server/mpm/winnt | |
parent | Remove all the CreateProcess() based code... see the prior commit (diff) | |
download | apache2-da73839710e28fb26136de5c538a41205c8a2f91.tar.xz apache2-da73839710e28fb26136de5c538a41205c8a2f91.zip |
Eliminate GetModuleFileName()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95931 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm/winnt')
-rw-r--r-- | server/mpm/winnt/mpm_winnt.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index c695d43758..868c73a9bb 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -2002,7 +2002,7 @@ void winnt_rewrite_args(process_rec *process) */ apr_status_t rv; char *def_server_root; - char fnbuf[MAX_PATH]; + char *binpath; char optbuf[3]; const char *optarg; int fixed_args; @@ -2054,23 +2054,23 @@ void winnt_rewrite_args(process_rec *process) * The requested service's (-n) registry ConfigArgs * The WinNT SCM's StartService() args */ - if (!GetModuleFileName(NULL, fnbuf, sizeof(fnbuf))) { - rv = apr_get_os_error(); + if ((rv = ap_os_proc_filepath(&binpath, process->pconf)) + != APR_SUCCESS) { ap_log_error(APLOG_MARK,APLOG_CRIT, rv, NULL, - "Failed to get the path of Apache.exe"); + "Failed to get the full path of %s", process->argv[0]); exit(APEXIT_INIT); } /* WARNING: There is an implict assumption here that the * executable resides in ServerRoot or ServerRoot\bin */ - def_server_root = (char *) apr_filename_of_pathname(fnbuf); - if (def_server_root > fnbuf) { + def_server_root = (char *) apr_filename_of_pathname(binpath); + if (def_server_root > binpath) { *(def_server_root - 1) = '\0'; - def_server_root = (char *) apr_filename_of_pathname(fnbuf); + def_server_root = (char *) apr_filename_of_pathname(binpath); if (!strcasecmp(def_server_root, "bin")) *(def_server_root - 1) = '\0'; } - apr_filepath_merge(&def_server_root, NULL, fnbuf, + apr_filepath_merge(&def_server_root, NULL, binpath, APR_FILEPATH_TRUENAME, process->pool); /* Use process->pool so that the rewritten argv |