2002-03-20 Martin M. Hunt <hunt@redhat.com>
authorMartin Hunt <hunt@redhat.com>
Thu, 21 Mar 2002 02:11:03 +0000 (02:11 +0000)
committerMartin Hunt <hunt@redhat.com>
Thu, 21 Mar 2002 02:11:03 +0000 (02:11 +0000)
* 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.

gdb/gdbserver/gdbreplay.c
gdb/gdbserver/remote-utils.c

index ca10a06aa6074de98696ac54004c65f45eb194cc..dce4079e3f18a890b12866934b177b00bfaea9ab 100644 (file)
@@ -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 */
index d9213af8d64019f66ef803b9a5eb383d50121245..2746f9a2986017c988bb9c77279f80c789d96ba4 100644 (file)
@@ -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 */