Replace CONST with const
[deliverable/binutils-gdb.git] / gdb / ser-tcp.c
index 01e8ca033260af5b83142bd6cd853da8eab26f0f..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;
@@ -144,7 +146,7 @@ _initialize_ser_tcp (void)
   ops->readchar = ser_unix_readchar;
   ops->write = ser_unix_write;
   ops->flush_output = ser_unix_nop_flush_output;
-  ops->flush_input = ser_unix_nop_flush_input;
+  ops->flush_input = ser_unix_flush_input;
   ops->send_break = ser_unix_nop_send_break;
   ops->go_raw = ser_unix_nop_raw;
   ops->get_tty_state = ser_unix_nop_get_tty_state;
This page took 0.024476 seconds and 4 git commands to generate.