[lxc-devel] [lxc/master] sync.c: use correct types

brauner on Github lxc-bot at linuxcontainers.org
Sat May 7 05:42:43 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 365 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160507/31203e4c/attachment.bin>
-------------- next part --------------
From 821310ccb9b0972138e814970978847aa713f84e Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at mailbox.org>
Date: Sat, 7 May 2016 07:40:33 +0200
Subject: [PATCH] sync.c: use correct types

Signed-off-by: Christian Brauner <christian.brauner at mailbox.org>
---
 src/lxc/sync.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lxc/sync.c b/src/lxc/sync.c
index 82f68e3..01f0abb 100644
--- a/src/lxc/sync.c
+++ b/src/lxc/sync.c
@@ -36,7 +36,7 @@ lxc_log_define(lxc_sync, lxc);
 static int __sync_wait(int fd, int sequence)
 {
 	int sync = -1;
-	int ret;
+	ssize_t ret;
 
 	ret = read(fd, &sync, sizeof(sync));
 	if (ret < 0) {
@@ -47,8 +47,8 @@ static int __sync_wait(int fd, int sequence)
 	if (!ret)
 		return 0;
 
-	if (ret != sizeof(sync)) {
-		ERROR("unexpected sync size: %d expected %lu", ret, sizeof(sync));
+	if ((size_t)ret != sizeof(sync)) {
+		ERROR("unexpected sync size: %zd expected %zu", ret, sizeof(sync));
 		return -1;
 	}
 


More information about the lxc-devel mailing list