2005-07-29 Paul Brook <paul@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / ser-tcp.c
index abe6ed4a35bee66a8f09abfb5b5f14c5fbc753cc..c91e83cab4187660cc91a17ed1f4f506f4b8a9f1 100644 (file)
@@ -1,5 +1,6 @@
-/* Serial interface for raw TCP connections on Un*x like systems
-   Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001
+/* Serial interface for raw TCP connections on Un*x like systems.
+
+   Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2005
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -38,7 +39,7 @@
 #ifdef USE_WIN32API
 #include <winsock2.h>
 #define ETIMEDOUT WSAETIMEDOUT
-#define close closesocket
+#define close(fd) closesocket (fd)
 #define ioctl ioctlsocket
 #else
 #include <netinet/in.h>
 #include <signal.h>
 #include "gdb_string.h"
 
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
 static int net_open (struct serial *scb, const char *name);
 static void net_close (struct serial *scb);
 void _initialize_ser_tcp (void);
@@ -187,7 +192,8 @@ net_open (struct serial *scb, const char *name)
 
   /* Got something.  Is it an error? */
   {
-    int res, err, len;
+    int res, err;
+    socklen_t len;
     len = sizeof(err);
     /* On Windows, the fourth parameter to getsockopt is a "char *";
        on UNIX systems it is generally "void *".  The cast to "void *"
This page took 0.023821 seconds and 4 git commands to generate.