This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] Don't assume the name of Windows serial devices?



Is there any reason we restrict the Windows serial device names to "COM?" A user could have serial boards, com ports higher than 9 (\\.\COMX), or weird file devices that act like serial ports.


The following patch removes the code that rejects devices that don't start with the word "COM".

Comments?

Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716
2008-03-28  Carlos O'Donell  <carlos@codesourcery.com>

	* ser-mingw.c (ser_windows_open): Open requested name.

Index: gdb/ser-mingw.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-mingw.c,v
retrieving revision 1.12
diff -u -p -r1.12 ser-mingw.c
--- gdb/ser-mingw.c	1 Jan 2008 22:53:12 -0000	1.12
+++ gdb/ser-mingw.c	28 Mar 2008 14:32:56 -0000
@@ -51,13 +51,6 @@ ser_windows_open (struct serial *scb, co
   struct ser_windows_state *state;
   COMMTIMEOUTS timeouts;
 
-  /* Only allow COM ports.  */
-  if (strncmp (name, "COM", 3) != 0)
-    {
-      errno = ENOENT;
-      return -1;
-    }
-
   h = CreateFile (name, GENERIC_READ | GENERIC_WRITE, 0, NULL,
 		  OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
   if (h == INVALID_HANDLE_VALUE)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]