projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
22aa3d6
)
Use getprotobyname instead of hardwired number (in tcp_open).
author
Stu Grossman
<grossman@cygnus>
Sat, 29 May 1993 03:14:45 +0000
(
03:14
+0000)
committer
Stu Grossman
<grossman@cygnus>
Sat, 29 May 1993 03:14:45 +0000
(
03:14
+0000)
gdb/ser-tcp.c
patch
|
blob
|
history
diff --git
a/gdb/ser-tcp.c
b/gdb/ser-tcp.c
index 4f4fcdbc2c382a9b4fa08dfbe23ad0953ff19bed..3b30bf1f8cf080bb9e3d03af0da1013c97f65ee5 100644
(file)
--- a/
gdb/ser-tcp.c
+++ b/
gdb/ser-tcp.c
@@
-57,6
+57,7
@@
tcp_open(scb, name)
struct sockaddr_in sockaddr;
int tmp;
char hostname[100];
struct sockaddr_in sockaddr;
int tmp;
char hostname[100];
+ struct protoent *protoent;
port_str = strchr (name, ':');
port_str = strchr (name, ':');
@@
-98,8
+99,13
@@
tcp_open(scb, name)
return -1;
}
return -1;
}
+ protoent = getprotobyname ("tcp");
+ if (!protoent)
+ return -1;
+
tmp = 1;
tmp = 1;
- if (setsockopt (scb->fd, 6, TCP_NODELAY, (char *)&tmp, sizeof(tmp)))
+ if (setsockopt (scb->fd, protoent->p_proto, TCP_NODELAY,
+ (char *)&tmp, sizeof(tmp)))
return -1;
signal(SIGPIPE, SIG_IGN); /* If we don't do this, then GDB simply exits
return -1;
signal(SIGPIPE, SIG_IGN); /* If we don't do this, then GDB simply exits