[CRIU] [PATCH] pie: fix format string

Tycho Andersen tycho.andersen at canonical.com
Sun Feb 21 08:23:20 PST 2016


On some architectures, the result of sizeof() is an int, on others it is a
long. Let's just always cast it to a long to avoid build failures

Reported-by: Andrew Vagin <avagin at virtuozzo.com>
Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
CC: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/pie/parasite.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
index 2466665..035a5fa 100644
--- a/criu/pie/parasite.c
+++ b/criu/pie/parasite.c
@@ -521,7 +521,7 @@ static int __parasite_daemon_reply_ack(unsigned int cmd, int err)
 	m = ctl_msg_ack(cmd, err);
 	ret = sys_sendto(tsock, &m, sizeof(m), 0, NULL, 0);
 	if (ret != sizeof(m)) {
-		pr_err("Sent only %d bytes while %lu expected\n", ret, sizeof(m));
+		pr_err("Sent only %d bytes while %lu expected\n", ret, (unsigned long) sizeof(m));
 		return -1;
 	}
 
-- 
2.5.0



More information about the CRIU mailing list