Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Carlos O'Donell <carlos@codesourcery.com>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: [RFC] Don't assume the name of Windows serial devices?
Date: Fri, 28 Mar 2008 14:38:00 -0000	[thread overview]
Message-ID: <47ED02B6.8010805@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 399 bytes --]


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

[-- Attachment #2: gdb-serial.diff --]
[-- Type: text/x-patch, Size: 796 bytes --]

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)

             reply	other threads:[~2008-03-28 14:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-28 14:38 Carlos O'Donell [this message]
2008-03-28 14:45 ` Daniel Jacobowitz
2008-03-28 17:33   ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47ED02B6.8010805@codesourcery.com \
    --to=carlos@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox