From 75005b3a8e2897f056a0adabac591fbf4bad91cd Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 30 Mar 2010 23:09:48 +0000 Subject: sim: use socklen_t with accept() The accept() function takes a socklen_t, not an int. Using an int causes: dv-sockser.c: In function 'connected_p': dv-sockser.c:273: warning: pointer targets in passing argument 3 of 'accept' differ in signedness So use the same socklen_t detection code as gdb and convert the accept(). --- sim/common/dv-sockser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sim/common/dv-sockser.c') diff --git a/sim/common/dv-sockser.c b/sim/common/dv-sockser.c index 9195190..03d49da 100644 --- a/sim/common/dv-sockser.c +++ b/sim/common/dv-sockser.c @@ -55,6 +55,10 @@ along with this program. If not, see . */ #include "dv-sockser.h" +#ifndef HAVE_SOCKLEN_T +typedef int socklen_t; +#endif + /* Get definitions for both O_NONBLOCK and O_NDELAY. */ #ifndef O_NDELAY @@ -243,7 +247,7 @@ connected_p (SIM_DESC sd) struct timeval tv; fd_set readfds; struct sockaddr sockaddr; - int addrlen; + socklen_t addrlen; if (sockser_listen_fd == -1) return 0; -- cgit v1.1