[PATCH 1 of 2] Fix printf conversion for st_size and iov_len

Brandon Philips brandon at ifup.org
Sat Mar 22 02:16:11 PDT 2008


# HG changeset patch
# User Brandon Philips <brandon at ifup.org>
# Date 1206175336 25200
# Node ID a9f7c8a24a02045a1c9d83a6c00623a6a0526e0a
# Parent  2b99a227eeaf5a2056acf89a6aadc48c8697cba5
Fix printf conversion for st_size and iov_len

off_t is opaque so bump to umaxint_t
iov_len is a size_t

Signed-off-by: Brandon Philips <bphilips at suse.de>

diff --git a/crfsd/config.c b/crfsd/config.c
--- a/crfsd/config.c
+++ b/crfsd/config.c
@@ -264,9 +264,9 @@ int config_load(char *path)
 
 	config = malloc(st.st_size + 1);
 	if (config == NULL) {
-		log_err("malloc(%zu) returned NULL ("ERRNOFMT") when trying "
+		log_err("malloc(%ju) returned NULL ("ERRNOFMT") when trying "
 			"to allocate memory for the config file",
-			st.st_size + 1, ERRNOARG);
+			(uintmax_t)st.st_size + 1, ERRNOARG);
 		ret = -errno;
 		goto out;
 	}
@@ -274,8 +274,8 @@ int config_load(char *path)
 
 	sret = read(fd, config, st.st_size);
 	if (sret != st.st_size) {
-		log_err("read([%s], %zu) returned %zd ("ERRNOFMT") when "
-			"trying to read the config file", path, st.st_size,
+		log_err("read([%s], %ju) returned %zd ("ERRNOFMT") when "
+			"trying to read the config file", path, (uintmax_t)st.st_size,
 			sret, ERRNOARG);
 		ret = -errno;
 		goto out;
diff --git a/crfsd/item.c b/crfsd/item.c
--- a/crfsd/item.c
+++ b/crfsd/item.c
@@ -226,7 +226,7 @@ void item_query(int fd, struct btr *btr,
 		iov[1].iov_len += copy_items(range, leaf.block, min, max);
 
 	log_dbg("reply min " BTR_KEY_FMT " max " BTR_KEY_FMT 
-		" nr %u tot bytes %lu",
+		" nr %u tot bytes %zu",
 		BTR_KEY_ARG(min), BTR_KEY_ARG(max),
 		from_le16(range->nr_items), iov[1].iov_len);
 
diff --git a/crfsd/send.c b/crfsd/send.c
--- a/crfsd/send.c
+++ b/crfsd/send.c
@@ -122,7 +122,7 @@ void send_message(int fd, struct iovec *
 
 	assertf(nr_vec >= 1, "nr_vec = %zu", nr_vec);
 	assertf(iov[0].iov_len == sizeof(struct crfs_msg_header),
-		".iov_len = %lu", iov[0].iov_len);
+		".iov_len = %zu", iov[0].iov_len);
 
 	hdr = iov[0].iov_base;
 



More information about the crfs-devel mailing list