diff options
author | Martin Hunt <hunt@redhat.com> | 2002-03-21 02:11:03 +0000 |
---|---|---|
committer | Martin Hunt <hunt@redhat.com> | 2002-03-21 02:11:03 +0000 |
commit | 373fe97f7f01a3b0bafb289ccc08020873a00b55 (patch) | |
tree | a18e41bc268cc1833b9b24837392762feb8a85ae /gdb/gdbserver | |
parent | 7781cd62b41e515209907417b97d1cad9b3ad426 (diff) | |
download | gdb-373fe97f7f01a3b0bafb289ccc08020873a00b55.zip gdb-373fe97f7f01a3b0bafb289ccc08020873a00b55.tar.gz gdb-373fe97f7f01a3b0bafb289ccc08020873a00b55.tar.bz2 |
2002-03-20 Martin M. Hunt <hunt@redhat.com>
* gdbserver/remote-utils.c (remote_open): Don't call
getprotobyname, we're all using TCP here so just use
IPPROTO_TCP.
* gdbserver/gdbreplay.c (remote_open): Ditto.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/gdbreplay.c | 7 | ||||
-rw-r--r-- | gdb/gdbserver/remote-utils.c | 7 |
2 files changed, 2 insertions, 12 deletions
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c index ca10a06..dce4079 100644 --- a/gdb/gdbserver/gdbreplay.c +++ b/gdb/gdbserver/gdbreplay.c @@ -97,7 +97,6 @@ remote_open (char *name) int port; struct sockaddr_in sockaddr; int tmp; - struct protoent *protoent; int tmp_desc; port_str = strchr (name, ':'); @@ -126,10 +125,6 @@ remote_open (char *name) if (remote_desc == -1) perror_with_name ("Accept failed"); - protoent = getprotobyname ("tcp"); - if (!protoent) - perror_with_name ("getprotobyname"); - /* Enable TCP keep alive process. */ tmp = 1; setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp)); @@ -137,7 +132,7 @@ remote_open (char *name) /* Tell TCP not to delay small packets. This greatly speeds up interactive response. */ tmp = 1; - setsockopt (remote_desc, protoent->p_proto, TCP_NODELAY, + setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY, (char *) &tmp, sizeof (tmp)); close (tmp_desc); /* No longer need this */ diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index d9213af..2746f9a 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -107,7 +107,6 @@ remote_open (char *name) int port; struct sockaddr_in sockaddr; int tmp; - struct protoent *protoent; int tmp_desc; port_str = strchr (name, ':'); @@ -136,10 +135,6 @@ remote_open (char *name) if (remote_desc == -1) perror_with_name ("Accept failed"); - protoent = getprotobyname ("tcp"); - if (!protoent) - perror_with_name ("getprotobyname"); - /* Enable TCP keep alive process. */ tmp = 1; setsockopt (tmp_desc, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (tmp)); @@ -147,7 +142,7 @@ remote_open (char *name) /* Tell TCP not to delay small packets. This greatly speeds up interactive response. */ tmp = 1; - setsockopt (remote_desc, protoent->p_proto, TCP_NODELAY, + setsockopt (remote_desc, IPPROTO_TCP, TCP_NODELAY, (char *) &tmp, sizeof (tmp)); close (tmp_desc); /* No longer need this */ |