提交 35b2a2d9 编写于 作者: G Guido Günther

virtlogd: use %llu to print 64bit types

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]
上级 c32d977e
...@@ -118,8 +118,9 @@ virLogManagerProtocolDispatchDomainReadLogFile(virNetServerPtr server ATTRIBUTE_ ...@@ -118,8 +118,9 @@ virLogManagerProtocolDispatchDomainReadLogFile(virNetServerPtr server ATTRIBUTE_
if (args->maxlen > VIR_LOG_MANAGER_PROTOCOL_STRING_MAX) { if (args->maxlen > VIR_LOG_MANAGER_PROTOCOL_STRING_MAX) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("Requested data len %zu is larger than maximum %d"), _("Requested data len %llu is larger than maximum %d"),
args->maxlen, VIR_LOG_MANAGER_PROTOCOL_STRING_MAX); (unsigned long long)args->maxlen,
VIR_LOG_MANAGER_PROTOCOL_STRING_MAX);
goto cleanup; goto cleanup;
} }
......
...@@ -57,8 +57,9 @@ static int testRotatingFileWriterAssertOneFileSize(const char *filename, ...@@ -57,8 +57,9 @@ static int testRotatingFileWriterAssertOneFileSize(const char *filename,
fprintf(stderr, "File %s should not exist\n", filename); fprintf(stderr, "File %s should not exist\n", filename);
return -1; return -1;
} else if (sb.st_size != size) { } else if (sb.st_size != size) {
fprintf(stderr, "File %s should be %zu bytes not %zu\n", fprintf(stderr, "File %s should be %llu bytes not %llu\n",
filename, size, sb.st_size); filename, (unsigned long long)size,
(unsigned long long)sb.st_size);
return -1; return -1;
} else { } else {
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册