aboutsummaryrefslogtreecommitdiff
path: root/sim/common/dv-sockser.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-03-30 23:09:48 +0000
committerMike Frysinger <vapier@gentoo.org>2010-03-30 23:09:48 +0000
commit75005b3a8e2897f056a0adabac591fbf4bad91cd (patch)
treedd9eae5df83dcf4f9be16094d08f0da4696e8126 /sim/common/dv-sockser.c
parent2422fad9eb9932dca8cdb98f38d9a024b786be1a (diff)
downloadgdb-75005b3a8e2897f056a0adabac591fbf4bad91cd.zip
gdb-75005b3a8e2897f056a0adabac591fbf4bad91cd.tar.gz
gdb-75005b3a8e2897f056a0adabac591fbf4bad91cd.tar.bz2
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().
Diffstat (limited to 'sim/common/dv-sockser.c')
-rw-r--r--sim/common/dv-sockser.c6
1 files changed, 5 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>. */
#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;