]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
PR:
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 1 Jun 2000 03:20:09 +0000 (03:20 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 1 Jun 2000 03:20:09 +0000 (03:20 +0000)
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

server/mpm/winnt/mpm_winnt.c
server/mpm/winnt/service.c

index 90b9e49937a27f82abee95315de5e3ad0f97514e..8ed685bf39f1e77406517837c0af17c71fc94e17 100644 (file)
@@ -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);
     }
@@ -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);
         }
@@ -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);
         }
@@ -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);
     }
@@ -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 
@@ -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());
             }
index 64797bdce01a4a2634e5a7be7c4d52112c2047c8..8ead0fbc0803b29ba652c0fefce94935b0883b0d 100644 (file)
@@ -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;
     }
 
@@ -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);
 }
@@ -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);
@@ -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);
@@ -904,7 +909,7 @@ 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;
@@ -912,7 +917,7 @@ void mpm_signal_service(ap_pool_t *ptemp, char *fname, int signal)
     }
     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;