Use @defvar to document gdb.pretty_printers
[deliverable/binutils-gdb.git] / gdb / ser-tcp.c
index 8f165bcf0b1c3a119070f381e2b8ba13c82ddbe1..039b0432231142b6cc18138607858384727bd43b 100644 (file)
@@ -1,6 +1,6 @@
 /* Serial interface for raw TCP connections on Un*x like systems.
 
-   Copyright (C) 1992-2018 Free Software Foundation, Inc.
+   Copyright (C) 1992-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,8 +24,8 @@
 #include "gdbcmd.h"
 #include "cli/cli-decode.h"
 #include "cli/cli-setshow.h"
-#include "filestuff.h"
-#include "netstuff.h"
+#include "common/filestuff.h"
+#include "common/netstuff.h"
 
 #include <sys/types.h>
 
 #include <sys/ioctl.h>  /* For FIONBIO.  */
 #endif
 
-#include "gdb_sys_time.h"
+#include "common/gdb_sys_time.h"
 
 #ifdef USE_WIN32API
-#include <winsock2.h>
-#include <wspiapi.h>
+#if _WIN32_WINNT < 0x0501
+# undef _WIN32_WINNT
+# define _WIN32_WINNT 0x0501
+#endif
+#include <ws2tcpip.h>
 #ifndef ETIMEDOUT
 #define ETIMEDOUT WSAETIMEDOUT
 #endif
@@ -171,7 +174,11 @@ try_connect (const struct addrinfo *ainfo, unsigned int *polls)
     return -1;
 
   /* Set socket nonblocking.  */
+#ifdef USE_WIN32API
+  u_long ioarg = 1;
+#else
   int ioarg = 1;
+#endif
 
   ioctl (sock, FIONBIO, &ioarg);
 
@@ -367,7 +374,7 @@ net_open (struct serial *scb, const char *name)
 
   ioctl (scb->fd, FIONBIO, &ioarg);
 
-  if (success_ainfo->ai_socktype == IPPROTO_TCP)
+  if (success_ainfo->ai_protocol == IPPROTO_TCP)
     {
       /* Disable Nagle algorithm.  Needed in some cases.  */
       int tmp = 1;
This page took 0.024843 seconds and 4 git commands to generate.