projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* config/i386/tm-cygwin.h: include tm-i386.h instead of tm-i386v.h. This fixes
[binutils-gdb.git]
/
gdb
/
ser-tcp.c
diff --git
a/gdb/ser-tcp.c
b/gdb/ser-tcp.c
index 7f6b65a5411c43ab94e08fa7409a9d5c74f07b97..9a868e8df7293b6e7a4e6fc51e786faf4720608d 100644
(file)
--- a/
gdb/ser-tcp.c
+++ b/
gdb/ser-tcp.c
@@
-29,22
+29,20
@@
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/socket.h>
-#ifndef __CYGWIN32__
#include <netinet/tcp.h>
#include <netinet/tcp.h>
-#endif
#include <signal.h>
#include "gdb_string.h"
#include <signal.h>
#include "gdb_string.h"
-static int tcp_open (s
erial_t
scb, const char *name);
-static void tcp_close (s
erial_t
scb);
+static int tcp_open (s
truct serial *
scb, const char *name);
+static void tcp_close (s
truct serial *
scb);
void _initialize_ser_tcp (void);
/* Open up a raw tcp socket */
static int
void _initialize_ser_tcp (void);
/* Open up a raw tcp socket */
static int
-tcp_open (s
erial_t
scb, const char *name)
+tcp_open (s
truct serial *
scb, const char *name)
{
char *port_str;
int port;
{
char *port_str;
int port;
@@
-65,6
+63,9
@@
tcp_open (serial_t scb, const char *name)
hostname[tmp] = '\000'; /* Tie off host name */
port = atoi (port_str + 1);
hostname[tmp] = '\000'; /* Tie off host name */
port = atoi (port_str + 1);
+ if (!hostname[0])
+ strcpy (hostname, "localhost");
+
hostent = gethostbyname (hostname);
if (!hostent)
hostent = gethostbyname (hostname);
if (!hostent)
@@
-124,7
+125,7
@@
tcp_open (serial_t scb, const char *name)
}
static void
}
static void
-tcp_close (s
erial_t
scb)
+tcp_close (s
truct serial *
scb)
{
if (scb->fd < 0)
return;
{
if (scb->fd < 0)
return;