Skip to content

Commit

Permalink
PR:
Browse files Browse the repository at this point in the history
Obtained from:
Submitted by:
Reviewed by:

  Just a few error cleanups for tonight.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85363 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
wrowe committed Jun 1, 2000
1 parent b35b92d commit b5f0b42
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
23 changes: 12 additions & 11 deletions server/mpm/winnt/mpm_winnt.c
Expand Up @@ -1819,7 +1819,8 @@ void winnt_rewrite_args(process_rec *process)
/* WARNING: There is an implict assumption here that the
* executable resides in the ServerRoot!
*/
ap_log_error(APLOG_MARK,APLOG_ERR, GetLastError(), NULL,
rv = GetLastError();
ap_log_error(APLOG_MARK,APLOG_ERR, rv, NULL,
"Failed to get the running module's file name");
exit(1);
}
Expand Down Expand Up @@ -1923,14 +1924,14 @@ void winnt_rewrite_args(process_rec *process)
rv = mpm_merge_service_args(process->pool, mpm_new_argv,
fixed_args);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK,APLOG_ERR, rv, server_conf,
ap_log_error(APLOG_MARK,APLOG_ERR, rv, NULL,
"%s: ConfigArgs are missing from the registry.",
display_name);
}
}
else
{
ap_log_error(APLOG_MARK,APLOG_ERR, APR_BADARG, server_conf,
ap_log_error(APLOG_MARK,APLOG_ERR, APR_BADARG, NULL,
"%s: No installed service by that name.", display_name);
exit(1);
}
Expand All @@ -1939,7 +1940,7 @@ void winnt_rewrite_args(process_rec *process)
{
if (service_named == APR_SUCCESS)
{
ap_log_error(APLOG_MARK,APLOG_ERR, APR_BADARG, server_conf,
ap_log_error(APLOG_MARK,APLOG_ERR, APR_BADARG, NULL,
"%s: Service is already installed.", display_name);
exit(1);
}
Expand Down Expand Up @@ -1970,8 +1971,8 @@ static void winnt_pre_config(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp
if (!strcasecmp(signal_arg, "runservice")
&& (osver.dwPlatformId == VER_PLATFORM_WIN32_NT)
&& (service_to_start_success != APR_SUCCESS)) {
ap_log_error(APLOG_MARK,APLOG_ERR, service_to_start_success,
server_conf, "%s: Unable to start the service manager.",
ap_log_error(APLOG_MARK,APLOG_ERR, service_to_start_success, NULL,
"%s: Unable to start the service manager.",
display_name);
exit(1);
}
Expand Down Expand Up @@ -2013,18 +2014,18 @@ static void winnt_post_config(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptem
*/

if (!strcasecmp(signal_arg, "install")) {
mpm_service_install(ptemp, inst_argc, inst_argv);
exit(rv);
rv = mpm_service_install(ptemp, inst_argc, inst_argv);
exit (rv);
}

if (!strcasecmp(signal_arg, "start")) {
rv = mpm_service_start(ptemp, inst_argc, inst_argv);
exit(rv);
exit (rv);
}

if (!strcasecmp(signal_arg, "restart")) {
mpm_signal_service(ptemp, ap_pid_fname, 1);
exit(0);
exit (rv);
}

// TODO: This Stinks - but we needed the ap_pid_fname entry from
Expand Down Expand Up @@ -2146,7 +2147,7 @@ API_EXPORT(int) ap_mpm_run(ap_pool_t *_pconf, ap_pool_t *plog, server_rec *s )
const char *pidfile = ap_server_root_relative (pconf, ap_pid_fname);

if (pidfile != NULL && unlink(pidfile) == 0) {
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,APR_SUCCESS,
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, APR_SUCCESS,
server_conf, "removed PID file %s (pid=%ld)",
pidfile, GetCurrentProcessId());
}
Expand Down
17 changes: 11 additions & 6 deletions server/mpm/winnt/service.c
Expand Up @@ -372,7 +372,8 @@ static void __stdcall service_nt_main_fn(DWORD argc, LPTSTR *argv)
if(!(globdat.hServiceStatus = RegisterServiceCtrlHandler(argv[0], service_nt_ctrl)))
{
ap_log_error(APLOG_MARK, APLOG_ERR, GetLastError(), NULL,
"Failure registering service handler");
"Failure registering service handler");
PulseEvent(globdat.signal_monitor);
return;
}

Expand Down Expand Up @@ -432,7 +433,8 @@ DWORD WINAPI service_nt_dispatch_thread(LPVOID nada)
rv = GetLastError();
ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
"Error starting service control dispatcher");
};
}

globdat.service_thread = 0;
return (rv);
}
Expand Down Expand Up @@ -624,7 +626,8 @@ ap_status_t mpm_service_install(ap_pool_t *ptemp, int argc,

if (!schService)
{
ap_log_error(APLOG_MARK, APLOG_ERR, GetLastError(), NULL,
rv = GetLastError();
ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
"Failed to create WinNT Service Profile");
CloseServiceHandle(schSCManager);
return (rv);
Expand Down Expand Up @@ -736,7 +739,9 @@ ap_status_t mpm_service_uninstall(void)

/* we blast Services/us, not just the Services/us/Parameters branch */
ap_snprintf(key_name, sizeof(key_name), SERVICECONFIG, service_name);
if (ap_registry_delete_key(key_name)) {
if (ap_registry_delete_key(key_name))
{
rv = GetLastError();
ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
"%s: Failed to remove the service config from the "
"registry.", display_name);
Expand Down Expand Up @@ -904,15 +909,15 @@ void mpm_signal_service(ap_pool_t *ptemp, char *fname, int signal)
}
if (!readpid)
{
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
"%s: could not retrieve pid from file %s",
display_name, pid_file);
return;
}
}
else
{
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
"%s: could not retrieve pid from file %s",
display_name, pid_file);
return;
Expand Down

0 comments on commit b5f0b42

Please sign in to comment.