/* 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;
hostname[tmp] = '\000'; /* Tie off host name */
port = atoi (port_str + 1);
+ if (!hostname[0])
+ strcpy (hostname, "localhost");
+
hostent = gethostbyname (hostname);
if (!hostent)
}
static void
-tcp_close (serial_t scb)
+tcp_close (struct serial *scb)
{
if (scb->fd < 0)
return;