[CRIU] [PATCH 2/8] cr: use the length modifier %z to print an integer of the type size_t

Alexander Kartashov alekskartashov at parallels.com
Fri Jan 18 02:08:33 EST 2013


Signed-off-by: Alexander Kartashov <alekskartashov at parallels.com>
---
 pipes.c     |    2 +-
 sk-packet.c |    2 +-
 util.c      |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pipes.c b/pipes.c
index 16a2454..b68770f 100644
--- a/pipes.c
+++ b/pipes.c
@@ -185,7 +185,7 @@ int restore_pipe_data(int img_type, int pfd, u32 id, struct pipe_data_rst **hash
 		}
 
 		if (ret == 0 || ret > iov.iov_len /* sanity */) {
-			pr_err("%#x: Wanted to restore %lu bytes, but got %d\n", id,
+			pr_err("%#x: Wanted to restore %zu bytes, but got %d\n", id,
 					iov.iov_len, ret);
 			ret = -1;
 			goto err;
diff --git a/sk-packet.c b/sk-packet.c
index 5338313..5151e5f 100644
--- a/sk-packet.c
+++ b/sk-packet.c
@@ -344,7 +344,7 @@ static int restore_mreqs(int sk, PacketSockEntry *pse)
 		pr_info("Restoring mreq type %d\n", ml->type);
 
 		if (ml->addr.len > sizeof(mreq.mr_address)) {
-			pr_err("To big mcaddr %lu\n", ml->addr.len);
+			pr_err("To big mcaddr %zu\n", ml->addr.len);
 			return -1;
 		}
 
diff --git a/util.c b/util.c
index baf8090..2b2596e 100644
--- a/util.c
+++ b/util.c
@@ -388,7 +388,7 @@ int copy_file(int fd_in, int fd_out, size_t bytes)
 
 		if (ret == 0) {
 			if (bytes && (written != bytes)) {
-				pr_err("Ghost file size mismatch %lu/%lu\n",
+				pr_err("Ghost file size mismatch %zu/%zu\n",
 						written, bytes);
 				return -1;
 			}
@@ -436,7 +436,7 @@ void *shmalloc(size_t bytes)
 	void *ret;
 
 	if (bytes > SH_BUF_CHUNK) {
-		pr_err("Too big shared buffer requested %lu\n", bytes);
+		pr_err("Too big shared buffer requested %zu\n", bytes);
 		return NULL;
 	}
 
-- 
1.7.10.4



More information about the CRIU mailing list