]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
virtlogd: use %llu to print 64bit types
authorGuido Günther <agx@sigxcpu.org>
Thu, 26 Nov 2015 17:00:09 +0000 (18:00 +0100)
committerGuido Günther <agx@sigxcpu.org>
Thu, 26 Nov 2015 18:37:37 +0000 (19:37 +0100)
Otherwise we fail on 32bit with:

CC     logging/virtlogd-log_daemon_dispatch.o
logging/log_daemon_dispatch.c: In function 'virLogManagerProtocolDispatchDomainReadLogFile':
logging/log_daemon_dispatch.c:120:9: error: format '%zu' expects argument of type 'size_t', but argument 7 has type 'uint64_t' [-Werror=format]

src/logging/log_daemon_dispatch.c
tests/virrotatingfiletest.c

index 269255ad5f431f1d8bc28492cd60b2188983f889..160ab00a4bc8a349b0d3641278ef6301943b6c56 100644 (file)
@@ -118,8 +118,9 @@ virLogManagerProtocolDispatchDomainReadLogFile(virNetServerPtr server ATTRIBUTE_
 
     if (args->maxlen > VIR_LOG_MANAGER_PROTOCOL_STRING_MAX) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Requested data len %zu is larger than maximum %d"),
-                       args->maxlen, VIR_LOG_MANAGER_PROTOCOL_STRING_MAX);
+                       _("Requested data len %llu is larger than maximum %d"),
+                       (unsigned long long)args->maxlen,
+                       VIR_LOG_MANAGER_PROTOCOL_STRING_MAX);
         goto cleanup;
     }
 
index ed55e6384e27fbdf1abdf0fc9b5f19b3acfaea6d..03e9664347563e97b877eafd8ac5a9617c99c384 100644 (file)
@@ -57,8 +57,9 @@ static int testRotatingFileWriterAssertOneFileSize(const char *filename,
             fprintf(stderr, "File %s should not exist\n", filename);
             return -1;
         } else if (sb.st_size != size) {
-            fprintf(stderr, "File %s should be %zu bytes not %zu\n",
-                    filename, size, sb.st_size);
+            fprintf(stderr, "File %s should be %llu bytes not %llu\n",
+                    filename, (unsigned long long)size,
+                    (unsigned long long)sb.st_size);
             return -1;
         } else {
             return 0;