[dm-devel] [PATCH 54/72] libmpathcmd: fix -Wsign-compare warnings

Martin Wilck Martin.Wilck at suse.com
Sat Oct 12 21:28:44 UTC 2019


From: Martin Wilck <mwilck at suse.com>

Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 libmpathcmd/mpath_cmd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c
index f00bf7e1..60b2d965 100644
--- a/libmpathcmd/mpath_cmd.c
+++ b/libmpathcmd/mpath_cmd.c
@@ -96,7 +96,8 @@ static size_t write_all(int fd, const void *buf, size_t len)
  */
 int __mpath_connect(int nonblocking)
 {
-	int fd, len;
+	int fd;
+	size_t len;
 	struct sockaddr_un addr;
 	int flags = 0;
 
@@ -172,7 +173,7 @@ int mpath_recv_reply_data(int fd, char *reply, size_t len,
 	ret = read_all(fd, reply, len, timeout);
 	if (ret < 0)
 		return ret;
-	if (ret != len) {
+	if ((size_t)ret != len) {
 		errno = EIO;
 		return -1;
 	}
-- 
2.23.0





More information about the dm-devel mailing list