]> granicus.if.org Git - apache/commitdiff
Use apr_snprintf(... "%pm"...) instead of explicit call to apr_strerror
authorChristophe Jaillet <jailletc36@apache.org>
Tue, 2 Apr 2013 20:20:12 +0000 (20:20 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Tue, 2 Apr 2013 20:20:12 +0000 (20:20 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1463736 13f79535-47bb-0310-9956-ffa450edef68

support/rotatelogs.c

index b4603fb865324ac700b12c7bb23a7245f4d90277..039fdec602c31901e7c66941b423f20e8f1a4679 100644 (file)
@@ -668,19 +668,17 @@ int main (int argc, const char * const argv[])
         nWrite = nRead;
         rv = apr_file_write_full(status.current.fd, buf, nWrite, &nWrite);
         if (nWrite != nRead) {
-            char strerrbuf[120];
             apr_off_t cur_offset;
 
             cur_offset = 0;
             if (apr_file_seek(status.current.fd, APR_CUR, &cur_offset) != APR_SUCCESS) {
                 cur_offset = -1;
             }
-            apr_strerror(rv, strerrbuf, sizeof strerrbuf);
             status.nMessCount++;
             apr_snprintf(status.errbuf, sizeof status.errbuf,
                          "Error %d writing to log file at offset %" APR_OFF_T_FMT ". "
-                         "%10d messages lost (%s)\n",
-                         rv, cur_offset, status.nMessCount, strerrbuf);
+                         "%10d messages lost (%pm)\n",
+                         rv, cur_offset, status.nMessCount, &rv);
 
             truncate_and_write_error(&status);
         }