]> granicus.if.org Git - apache/commitdiff
With rotatelogs -v, on platforms where APR_FINFO_NAME is not implemented,
authorDaniel Earl Poirier <poirier@apache.org>
Tue, 19 Oct 2010 18:57:31 +0000 (18:57 +0000)
committerDaniel Earl Poirier <poirier@apache.org>
Tue, 19 Oct 2010 18:57:31 +0000 (18:57 +0000)
the verbose printf for closing the file never occurred because apr_file_info_get()
always returned APR_INCOMPLETE.  Fix that so we still get a printf with the
information we get back.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024359 13f79535-47bb-0310-9956-ffa450edef68

support/rotatelogs.c

index 213005cc4c717e912e9fb1770db2a175684a814c..37f11096767a493250ac01a6906364c33e2eac6f 100644 (file)
@@ -175,8 +175,13 @@ static void closeFile(rotate_config_t *config, apr_pool_t *pool, apr_file_t *fil
         if (config->verbose) {
             apr_finfo_t finfo;
             apr_int32_t wanted = APR_FINFO_NAME;
-            if (apr_file_info_get(&finfo, wanted, file) == APR_SUCCESS) {
-                fprintf(stderr, "Closing file %s (%s)\n", finfo.name, finfo.fname);
+            apr_status_t rv = apr_file_info_get(&finfo, wanted, file);
+            if ((rv == APR_SUCCESS) || (rv == APR_INCOMPLETE)) {
+                if (finfo.valid & APR_FINFO_NAME) {
+                    fprintf(stderr, "Closing file %s (%s)\n", finfo.name, finfo.fname);
+                } else {
+                    fprintf(stderr, "Closing file %s\n", finfo.fname);
+                }
             }
         }
         apr_file_close(file);