AArch64: Refactor verifiers to make more general.
[deliverable/binutils-gdb.git] / gdb / serial.c
index fb2b212918cc778ca07407298212b9445013a928..7f9362a3bf35550fdc5cad7a5ec4c8668c637538 100644 (file)
@@ -213,7 +213,17 @@ serial_open (const char *name)
   else if (strchr (name, ':'))
     ops = serial_interface_lookup ("tcp");
   else
-    ops = serial_interface_lookup ("hardwire");
+    {
+#ifndef USE_WIN32API
+      /* Check to see if name is a socket.  If it is, then treat it
+         as such.  Otherwise assume that it's a character device.  */
+      struct stat sb;
+      if (stat (name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFSOCK)
+       ops = serial_interface_lookup ("local");
+      else
+#endif
+       ops = serial_interface_lookup ("hardwire");
+    }
 
   if (!ops)
     return NULL;
This page took 0.035508 seconds and 4 git commands to generate.