x86: refine when to trigger optimizations
[deliverable/binutils-gdb.git] / gdb / ser-uds.c
index acace258be19d504926f25539a2437b6808949fc..7d216de13d50bcf4d70be6cf9f538f38d5c45fba 100644 (file)
@@ -1,6 +1,6 @@
 /* Serial interface for local domain connections on Un*x like systems.
 
-   Copyright (C) 1992-2018 Free Software Foundation, Inc.
+   Copyright (C) 1992-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -23,8 +23,6 @@
 
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <netdb.h>
-#include "netstuff.h"
 
 #ifndef UNIX_PATH_MAX
 #define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) NULL)->sun_path)
 static int
 uds_open (struct serial *scb, const char *name)
 {
-  struct addrinfo hint;
-
-  memset (&hint, 0, sizeof (hint));
-  /* Assume no prefix will be passed, therefore we should use
-     AF_UNSPEC.  */
-  hint.ai_family = AF_UNSPEC;
-  hint.ai_socktype = SOCK_STREAM;
-
-  parsed_connection_spec parsed = parse_connection_spec (name, &hint);
-
-  const char *socket_name = parsed.port_str.empty() ? name : parsed.port_str.c_str ();
-
   struct sockaddr_un addr;
 
-  if (strlen (socket_name) > UNIX_PATH_MAX - 1)
+  if (strlen (name) > UNIX_PATH_MAX - 1)
     {
       warning
         (_("The socket name is too long.  It may be no longer than %s bytes."),
@@ -59,7 +45,7 @@ uds_open (struct serial *scb, const char *name)
 
   memset (&addr, 0, sizeof addr);
   addr.sun_family = AF_UNIX;
-  strncpy (addr.sun_path, socket_name, UNIX_PATH_MAX - 1);
+  strncpy (addr.sun_path, name, UNIX_PATH_MAX - 1);
 
   int sock = socket (AF_UNIX, SOCK_STREAM, 0);
 
This page took 0.025267 seconds and 4 git commands to generate.