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

Message ID 20170322022308.22317-1-rosenp@gmail.com
State New
Delegated to: Felix Fietkau
Headers show

Commit Message

Rosen Penev March 22, 2017, 2:23 a.m.
A few types were changed to adhere to the particular API.

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

Patch

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;