* dwarf2dbg.c (dwarf2_directive_file): Avoid signed/unsigned warning.
[deliverable/binutils-gdb.git] / gdb / ser-tcp.c
index 86baf34910877298209ff3eb1ed4cfc67d60d5fe..9a868e8df7293b6e7a4e6fc51e786faf4720608d 100644 (file)
@@ -1,5 +1,6 @@
 /* Serial interface for raw TCP connections on Un*x like systems
-   Copyright 1992, 1993, 1998-1999 Free Software Foundation, Inc.
+   Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2001
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <sys/socket.h>
-#ifndef __CYGWIN32__
 #include <netinet/tcp.h>
-#endif
 
-#include "signals.h"
+#include <signal.h>
 #include "gdb_string.h"
 
-static int tcp_open (serial_t scb, const char *name);
-static void tcp_close (serial_t scb);
+static int tcp_open (struct serial *scb, const char *name);
+static void tcp_close (struct serial *scb);
 
 void _initialize_ser_tcp (void);
 
 /* Open up a raw tcp socket */
 
 static int
-tcp_open (serial_t scb, const char *name)
+tcp_open (struct serial *scb, const char *name)
 {
   char *port_str;
   int port;
@@ -64,6 +63,9 @@ tcp_open (serial_t scb, const char *name)
   hostname[tmp] = '\000';      /* Tie off host name */
   port = atoi (port_str + 1);
 
+  if (!hostname[0])
+    strcpy (hostname, "localhost");
+
   hostent = gethostbyname (hostname);
 
   if (!hostent)
@@ -123,7 +125,7 @@ tcp_open (serial_t scb, const char *name)
 }
 
 static void
-tcp_close (serial_t scb)
+tcp_close (struct serial *scb)
 {
   if (scb->fd < 0)
     return;
This page took 0.024647 seconds and 4 git commands to generate.