diff options
author | Alasdair G Kergon <agk@redhat.com> | 2015-07-06 15:09:17 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2015-07-06 15:09:17 +0100 |
commit | 810ab095e6709364d9f7c86d3754762aab3d976d (patch) | |
tree | 952810533448cb2ac1dbaf128ac1a5a5d5a7404e /libdaemon | |
parent | 5fb71bd53062011dd962d77b233552ffad128238 (diff) | |
download | lvm2-810ab095e6709364d9f7c86d3754762aab3d976d.tar.gz |
macros: Wrap PRI with FMT.
Create a set of wrappers with embedded % such as
#define FMTu64 "%" PRIu64
Diffstat (limited to 'libdaemon')
-rw-r--r-- | libdaemon/client/config-util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libdaemon/client/config-util.c b/libdaemon/client/config-util.c index 067c9126a..c417def36 100644 --- a/libdaemon/client/config-util.c +++ b/libdaemon/client/config-util.c @@ -14,6 +14,7 @@ #include "daemon-io.h" #include "dm-logging.h" +#include "util.h" #include <errno.h> #include <stdio.h> @@ -39,7 +40,7 @@ int buffer_append_vf(struct buffer *buf, va_list ap) goto fail; } keylen = strchr(next, '=') - next; - if (strstr(next, "%d") || strstr(next, "%" PRId64)) { + if (strstr(next, "%d") || strstr(next, FMTd64)) { value = va_arg(ap, int64_t); if (dm_asprintf(&append, "%.*s= %" PRId64 "\n", keylen, next, value) < 0) goto fail; @@ -237,7 +238,7 @@ struct dm_config_node *config_make_nodes_v(struct dm_config_tree *cft, key[fmt - next] = '\0'; fmt += 2; - if (!strcmp(fmt, "%d") || !strcmp(fmt, "%" PRId64)) { + if (!strcmp(fmt, "%d") || !strcmp(fmt, FMTd64)) { int64_t value = va_arg(ap, int64_t); if (!(cn = make_int_node(cft, key, value, parent, pre_sib))) return 0; |