httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1467978 - in /httpd/httpd/branches/2.4.x: ./ STATUS modules/aaa/mod_authz_host.c support/htdigest.c support/httxt2dbm.c
Date Mon, 15 Apr 2013 12:39:55 GMT
Author: jim
Date: Mon Apr 15 12:39:55 2013
New Revision: 1467978

URL: http://svn.apache.org/r1467978
Log:
Merge r1463750, r1463754, r1464675 from trunk:

Use apr_file_printf(... "%pm"...) instead of explicit call to apr_strerror

Use apr_psprintf(... "%pm"...) instead of explicit call to apr_strerror

Use apr_file_printf(... "%pm"...) instead of explicit call to apr_strerror
+ add some spaces to improve formatting
Submitted by: jailletc36
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/modules/aaa/mod_authz_host.c
    httpd/httpd/branches/2.4.x/support/htdigest.c
    httpd/httpd/branches/2.4.x/support/httxt2dbm.c

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1463750,1463754,1464675

Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1467978&r1=1467977&r2=1467978&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Mon Apr 15 12:39:55 2013
@@ -90,14 +90,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * use %pm instead of explicit call to apr_strerror (more to be backported but they don't
-    apply out of the box for now)
-    trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1463750
-                 http://svn.apache.org/viewvc?view=revision&revision=1463754
-                 http://svn.apache.org/viewvc?view=revision&revision=1464675
-    2.4.x patch: trunk patchs work
-    +1: jailletc36, rjung, covener
-
   * ap_expr: Expression parser: Add the ability to apply a SHA1 hash to
     strings within the parser.
     trunk patch: http://svn.apache.org/r1457450

Modified: httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_host.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_host.c?rev=1467978&r1=1467977&r2=1467978&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_host.c (original)
+++ httpd/httpd/branches/2.4.x/modules/aaa/mod_authz_host.c Mon Apr 15 12:39:55 2013
@@ -131,10 +131,8 @@ static const char *ip_parse_config(cmd_p
             return apr_psprintf(p, "ip address '%s' appears to be invalid", w);
         }
         else if (rv != APR_SUCCESS) {
-            char msgbuf[120];
-            apr_strerror(rv, msgbuf, sizeof msgbuf);
-            return apr_psprintf(p, "ip address '%s' appears to be invalid: %s",
-                                w, msgbuf);
+            return apr_psprintf(p, "ip address '%s' appears to be invalid: %pm",
+                                w, &rv);
         }
 
         if (parsed_subnets)

Modified: httpd/httpd/branches/2.4.x/support/htdigest.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/htdigest.c?rev=1467978&r1=1467977&r2=1467978&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/support/htdigest.c (original)
+++ httpd/httpd/branches/2.4.x/support/htdigest.c Mon Apr 15 12:39:55 2013
@@ -202,8 +202,8 @@ int main(int argc, const char * const ar
 #if APR_CHARSET_EBCDIC
     rv = apr_xlate_open(&to_ascii, "ISO-8859-1", APR_DEFAULT_CHARSET, cntxt);
     if (rv) {
-        apr_file_printf(errfile, "apr_xlate_open(): %s (%d)\n",
-                apr_strerror(rv, line, sizeof(line)), rv);
+        apr_file_printf(errfile, "apr_xlate_open(): %pm (%d)\n",
+                &rv, rv);
         exit(1);
     }
 #endif
@@ -215,11 +215,8 @@ int main(int argc, const char * const ar
         rv = apr_file_open(&f, argv[2], APR_WRITE | APR_CREATE,
                            APR_OS_DEFAULT, cntxt);
         if (rv != APR_SUCCESS) {
-            char errmsg[120];
-
-            apr_file_printf(errfile, "Could not open passwd file %s for writing: %s\n",
-                    argv[2],
-                    apr_strerror(rv, errmsg, sizeof errmsg));
+            apr_file_printf(errfile, "Could not open passwd file %s for writing: %pm\n",
+                    argv[2], &rv);
             exit(1);
         }
         apr_cpystrn(user, argv[4], sizeof(user));

Modified: httpd/httpd/branches/2.4.x/support/httxt2dbm.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/httxt2dbm.c?rev=1467978&r1=1467977&r2=1467978&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/support/httxt2dbm.c (original)
+++ httpd/httpd/branches/2.4.x/support/httxt2dbm.c Mon Apr 15 12:39:55 2013
@@ -39,7 +39,6 @@ static const char *output;
 static const char *format;
 static const char *shortname;
 static apr_file_t *errfile;
-static char errbuf[120];
 static int verbose;
 
 /* From mod_rewrite.c */
@@ -85,11 +84,11 @@ static void usage(void)
     "Usage: %s [-v] [-f format] -i SOURCE_TXT -o OUTPUT_DBM" NL
     NL
     "Options: " NL
-    " -v    More verbose output"NL
+    " -v    More verbose output" NL
     NL
-    " -i    Source Text File. If '-', use stdin."NL
+    " -i    Source Text File. If '-', use stdin." NL
     NL
-    " -o    Output DBM."NL
+    " -o    Output DBM." NL
     NL
     " -f    DBM Format.  If not specified, will use the APR Default." NL
     "           GDBM for GDBM files (%s)" NL
@@ -157,7 +156,7 @@ static apr_status_t to_dbm(apr_dbm_t *db
         dbmval.dsize = (c - value);
 
         if (verbose) {
-            apr_file_printf(errfile, "    '%s' -> '%s'"NL,
+            apr_file_printf(errfile, "    '%s' -> '%s'" NL,
                             dbmkey.dptr, dbmval.dptr);
         }
 
@@ -204,7 +203,7 @@ int main(int argc, const char *const arg
     rv = apr_getopt_init(&opt, pool, argc, argv);
 
     if (rv != APR_SUCCESS) {
-        apr_file_printf(errfile, "Error: apr_getopt_init failed."NL NL);
+        apr_file_printf(errfile, "Error: apr_getopt_init failed." NL NL);
         return 1;
     }
 
@@ -273,7 +272,7 @@ int main(int argc, const char *const arg
     }
 
     if (verbose) {
-        apr_file_printf(errfile, "DBM Format: %s"NL, format);
+        apr_file_printf(errfile, "DBM Format: %s" NL, format);
     }
 
     if (!strcmp(input, "-")) {
@@ -286,13 +285,13 @@ int main(int argc, const char *const arg
 
     if (rv != APR_SUCCESS) {
         apr_file_printf(errfile,
-                        "Error: Cannot open input file '%s': (%d) %s" NL NL,
-                         input, rv, apr_strerror(rv, errbuf, sizeof(errbuf)));
+                        "Error: Cannot open input file '%s': (%d) %pm" NL NL,
+                         input, rv, &rv);
         return 1;
     }
 
     if (verbose) {
-        apr_file_printf(errfile, "Input File: %s"NL, input);
+        apr_file_printf(errfile, "Input File: %s" NL, input);
     }
 
     rv = apr_dbm_open_ex(&outdbm, format, output, APR_DBM_RWCREATE,
@@ -307,21 +306,21 @@ int main(int argc, const char *const arg
 
     if (rv != APR_SUCCESS) {
         apr_file_printf(errfile,
-                        "Error: Cannot open output DBM '%s': (%d) %s" NL NL,
-                         output, rv, apr_strerror(rv, errbuf, sizeof(errbuf)));
+                        "Error: Cannot open output DBM '%s': (%d) %pm" NL NL,
+                         output, rv, &rv);
         return 1;
     }
 
     if (verbose) {
-        apr_file_printf(errfile, "DBM File: %s"NL, output);
+        apr_file_printf(errfile, "DBM File: %s" NL, output);
     }
 
     rv = to_dbm(outdbm, infile, pool);
 
     if (rv != APR_SUCCESS) {
         apr_file_printf(errfile,
-                        "Error: Converting to DBM: (%d) %s" NL NL,
-                         rv, apr_strerror(rv, errbuf, sizeof(errbuf)));
+                        "Error: Converting to DBM: (%d) %pm" NL NL,
+                         rv, &rv);
         return 1;
     }
 



Mime
View raw message