[LEDE-DEV] [PATCH] usock: Fix some types resulting in type conversion warnings.

Rosen Penev rosenp at gmail.com
Tue Mar 21 19:23:08 PDT 2017


A few types were changed to adhere to the particular API.

Signed-off by: Rosen Penev <rosenp at gmail.com>
---
 usock.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/usock.c b/usock.c
index 0ce5390..c159a76 100644
--- a/usock.c
+++ b/usock.c
@@ -33,7 +33,7 @@
 #include "usock.h"
 #include "utils.h"
 
-static void usock_set_flags(int sock, unsigned int type)
+static void usock_set_flags(int sock, int type)
 {
 	if (!(type & USOCK_NOCLOEXEC))
 		fcntl(sock, F_SETFD, fcntl(sock, F_GETFD) | FD_CLOEXEC);
@@ -42,7 +42,7 @@ static void usock_set_flags(int sock, unsigned int type)
 		fcntl(sock, F_SETFL, fcntl(sock, F_GETFL) | O_NONBLOCK);
 }
 
-static int usock_connect(int type, struct sockaddr *sa, int sa_len, int family, int socktype, bool server)
+static int usock_connect(int type, struct sockaddr *sa, socklen_t sa_len, int family, int socktype, bool server)
 {
 	int sock;
 
@@ -103,7 +103,7 @@ usock_inet_notimeout(int type, struct addrinfo *result, void *addr)
 	return -1;
 }
 
-static int poll_restart(struct pollfd *fds, int nfds, int timeout)
+static int poll_restart(struct pollfd *fds, nfds_t nfds, int timeout)
 {
 	struct timespec ts, cur;
 	int msec = timeout % 1000;
-- 
2.9.3




More information about the Lede-dev mailing list