[CRIU] [crtools-bot] files.c: fix printf format warnings

Cyrill Gorcunov gorcunov at openvz.org
Tue Jan 31 06:57:34 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit cced37daffe27c59b36b55e736b04f9efa1efec1
Author: Kir Kolyshkin <kir at openvz.org>
Date:   Tue Jan 31 15:31:28 2012 +0400

    files.c: fix printf format warnings
    
    files.c: In function ‘collect_fd’:
    files.c:111:2: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘u64’
    files.c: In function ‘open_fd’:
    files.c:348:3: error: format ‘%d’ expects type ‘int’, but argument 2 has type ‘u64’
    files.c: In function ‘receive_fd’:
    files.c:425:5: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘u64’
    files.c:425:5: error: format ‘%d’ expects type ‘int’, but argument 5 has type ‘u64’
    
    Signed-off-by: Kir Kolyshkin <kir at openvz.org>
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 files.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/files.c b/files.c
index 626ab79..a1ff413 100644
--- a/files.c
+++ b/files.c
@@ -108,7 +108,7 @@ static int collect_fd(int pid, struct fdinfo_entry *e)
 	struct fdinfo_list_entry *le = &fdinfo_list[nr_fdinfo_list];
 	struct fdinfo_desc	*desc;
 
-	pr_info("Collect fdinfo pid=%d fd=%d id=%s\n", pid, e->addr, e->id);
+	pr_info("Collect fdinfo pid=%d fd=%ld id=%s\n", pid, e->addr, e->id);
 
 	nr_fdinfo_list++;
 	if ((nr_fdinfo_descs) * sizeof(struct fdinfo_list_entry) >= 4096) {
@@ -345,7 +345,7 @@ static int open_fd(int pid, struct fdinfo_entry *fe,
 		snprintf(saddr.sun_path, UNIX_PATH_MAX,
 				"X/crtools-fd-%d-%d", fle->real_pid, fle->fd);
 
-		pr_info("Send fd %d to %s\n", fe->addr, saddr.sun_path + 1);
+		pr_info("Send fd %ld to %s\n", fe->addr, saddr.sun_path + 1);
 
 		data.iov_base = &dummy;
 		data.iov_len = sizeof(dummy);
@@ -422,7 +422,7 @@ static int receive_fd(int pid, struct fdinfo_entry *fe, struct fdinfo_desc *fi)
 		if (fi->addr != fe->addr) {
 			tmp = dup2(fi->addr, fe->addr);
 			if (tmp < 0) {
-				pr_perror("Can't duplicate fd %d %d",
+				pr_perror("Can't duplicate fd %ld %ld",
 						fi->addr, fe->addr);
 				return -1;
 			}


More information about the CRIU mailing list