From 9fdf7bc7715b9b00846d8f0b451533906a131eaa Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 6 Mar 2013 13:40:38 +0100 Subject: [PATCH] server: Use socklen_t where appropriate. --- server/request.c | 2 +- server/sock.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/request.c b/server/request.c index eeb34761f08..e075212a3ea 100644 --- a/server/request.c +++ b/server/request.c @@ -537,7 +537,7 @@ static void master_socket_poll_event( struct fd *fd, int event ) else if (event & POLLIN) { struct sockaddr_un dummy; - unsigned int len = sizeof(dummy); + socklen_t len = sizeof(dummy); int client = accept( get_unix_fd( master_socket->fd ), (struct sockaddr *) &dummy, &len ); if (client == -1) return; fcntl( client, F_SETFL, O_NONBLOCK ); diff --git a/server/sock.c b/server/sock.c index 7dcc1013679..ba18a6699b0 100644 --- a/server/sock.c +++ b/server/sock.c @@ -285,9 +285,9 @@ static void sock_wake_up( struct sock *sock ) static inline int sock_error( struct fd *fd ) { - unsigned int optval = 0, optlen; + unsigned int optval = 0; + socklen_t optlen = sizeof(optval); - optlen = sizeof(optval); getsockopt( get_unix_fd(fd), SOL_SOCKET, SO_ERROR, (void *) &optval, &optlen); return optval; } @@ -667,7 +667,7 @@ static int accept_new_fd( struct sock *sock ) */ int acceptfd; struct sockaddr saddr; - unsigned int slen = sizeof(saddr); + socklen_t slen = sizeof(saddr); acceptfd = accept( get_unix_fd(sock->fd), &saddr, &slen); if (acceptfd == -1) {