diff options
author | Petr Rockai <prockai@redhat.com> | 2012-09-09 21:57:59 +0200 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2012-09-26 17:26:16 +0200 |
commit | c9f56d639b6c6ddfae7749c64eba64a776ecc7d9 (patch) | |
tree | ad2f603f795c46f4b0442b98ff958897dc8921b1 /libdaemon | |
parent | c7b17836ea139ba7448f5a5c1d2fbe93676baa36 (diff) | |
download | lvm2-c9f56d639b6c6ddfae7749c64eba64a776ecc7d9.tar.gz |
lvmetad: Use "%" PRId64 in place of "%d" for extra clarity.
Diffstat (limited to 'libdaemon')
-rw-r--r-- | libdaemon/client/daemon-shared.c | 8 | ||||
-rw-r--r-- | libdaemon/server/daemon-server.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/libdaemon/client/daemon-shared.c b/libdaemon/client/daemon-shared.c index 4b98f514e..6a1cf0500 100644 --- a/libdaemon/client/daemon-shared.c +++ b/libdaemon/client/daemon-shared.c @@ -115,9 +115,9 @@ char *format_buffer_v(const char *head, va_list ap) goto fail; } keylen = strchr(next, '=') - next; - if (strstr(next, "%d")) { - int value = va_arg(ap, int); - dm_asprintf(&buffer, "%s%.*s= %d\n", buffer, keylen, next, value); + if (strstr(next, "%d") || strstr(next, "%" PRId64)) { + int64_t value = va_arg(ap, int64_t); + dm_asprintf(&buffer, "%s%.*s= %" PRId64 "\n", buffer, keylen, next, value); dm_free(old); } else if (strstr(next, "%s")) { char *value = va_arg(ap, char *); @@ -301,7 +301,7 @@ struct dm_config_node *config_make_nodes_v(struct dm_config_tree *cft, char *key = dm_pool_strdup(cft->mem, next); *strchr(key, '=') = 0; - if (!strcmp(fmt, "%d")) { + if (!strcmp(fmt, "%d") || !strcmp(fmt, "%" PRId64)) { int64_t value = va_arg(ap, int64_t); if (!(cn = make_int_node(cft, key, value, parent, pre_sib))) return 0; diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c index 76627c085..50bf06560 100644 --- a/libdaemon/server/daemon-server.c +++ b/libdaemon/server/daemon-server.c @@ -360,7 +360,7 @@ static response builtin_handler(daemon_state s, client_handle h, request r) if (!strcmp(rq, "hello")) { return daemon_reply_simple("OK", "protocol = %s", s.protocol ?: "default", - "version = %d", s.protocol_version, NULL); + "version = %" PRId64, (int64_t) s.protocol_version, NULL); } response res = { .buffer = NULL, .error = EPROTO }; |