You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2013/04/22 16:07:57 UTC

svn commit: r1470522 - in /httpd/httpd/branches/2.4.x: ./ STATUS server/log.c

Author: jim
Date: Mon Apr 22 14:07:56 2013
New Revision: 1470522

URL: http://svn.apache.org/r1470522
Log:
Merge r1463052 from trunk:

use ap_log_error's facility to print the apr error string instead of
calling apr_strerror() explicitly

Submitted by: sf
Reviewed/backported by: jim

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/STATUS
    httpd/httpd/branches/2.4.x/server/log.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1463052

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1470522&r1=1470521&r2=1470522&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Mon Apr 22 14:07:56 2013
@@ -96,12 +96,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.4.x patch: trunk patch applies if previous proposals for ap_expr get applied.
      +1: rjung, minfrin, sf
 
-    * log: use ap_log_error's facility to print the apr error string
-      instead of calling apr_strerror() explicitly
-      trunk patches: https://svn.apache.org/r1463052
-      2.4.x patch: trunk patch works
-      +1: jailletc36, minfrin, sf
-
     * various: Use %pm available since apr 1.3 instead of an extra call to apr_strerror
       trunk patches: https://svn.apache.org/r1463056
       2.4.x patch: trunk patch works (with offset)

Modified: httpd/httpd/branches/2.4.x/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/log.c?rev=1470522&r1=1470521&r2=1470522&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/log.c (original)
+++ httpd/httpd/branches/2.4.x/server/log.c Mon Apr 22 14:07:56 2013
@@ -1552,11 +1552,10 @@ static apr_status_t piped_log_spawn(pipe
         ((status = apr_procattr_child_errfn_set(procattr, log_child_errfn))
          != APR_SUCCESS) ||
         ((status = apr_procattr_error_check_set(procattr, 1)) != APR_SUCCESS)) {
-        char buf[120];
         /* Something bad happened, give up and go away. */
-        ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(00103)
-                     "piped_log_spawn: unable to setup child process '%s': %s",
-                     pl->program, apr_strerror(status, buf, sizeof(buf)));
+        ap_log_error(APLOG_MARK, APLOG_STARTUP, status, NULL, APLOGNO(00103)
+                     "piped_log_spawn: unable to setup child process '%s'",
+                     pl->program);
     }
     else {
         char **args;
@@ -1580,11 +1579,10 @@ static apr_status_t piped_log_spawn(pipe
             close_handle_in_child(pl->p, pl->read_fd);
         }
         else {
-            char buf[120];
             /* Something bad happened, give up and go away. */
-            ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(00104)
-                         "unable to start piped log program '%s': %s",
-                         pl->program, apr_strerror(status, buf, sizeof(buf)));
+            ap_log_error(APLOG_MARK, APLOG_STARTUP, status, NULL, APLOGNO(00104)
+                         "unable to start piped log program '%s'",
+                         pl->program);
         }
     }
 
@@ -1595,7 +1593,7 @@ static apr_status_t piped_log_spawn(pipe
 static void piped_log_maintenance(int reason, void *data, apr_wait_t status)
 {
     piped_log *pl = data;
-    apr_status_t stats;
+    apr_status_t rv;
     int mpm_state;
 
     switch (reason) {
@@ -1605,8 +1603,8 @@ static void piped_log_maintenance(int re
                          * tells other logic not to try to kill it
                          */
         apr_proc_other_child_unregister(pl);
-        stats = ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state);
-        if (stats != APR_SUCCESS) {
+        rv = ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state);
+        if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(00105)
                          "can't query MPM state; not restarting "
                          "piped log program '%s'",
@@ -1616,13 +1614,12 @@ static void piped_log_maintenance(int re
             ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(00106)
                          "piped log program '%s' failed unexpectedly",
                          pl->program);
-            if ((stats = piped_log_spawn(pl)) != APR_SUCCESS) {
+            if ((rv = piped_log_spawn(pl)) != APR_SUCCESS) {
                 /* what can we do?  This could be the error log we're having
                  * problems opening up... */
-                char buf[120];
-                ap_log_error(APLOG_MARK, APLOG_STARTUP, 0, NULL, APLOGNO(00107)
-                             "piped_log_maintenance: unable to respawn '%s': %s",
-                             pl->program, apr_strerror(stats, buf, sizeof(buf)));
+                ap_log_error(APLOG_MARK, APLOG_STARTUP, rv, NULL, APLOGNO(00107)
+                             "piped_log_maintenance: unable to respawn '%s'",
+                             pl->program);
             }
         }
         break;