delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/04/07/18:16:03

From: noer AT cygnus DOT com (Geoffrey Noer)
Subject: Re: Opening COM2
7 Apr 1997 18:16:03 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199704072159.OAA16472.cygnus.gnu-win32@cirdan.cygnus.com>
Original-To: rwilson AT cfawilson DOT harvard DOT edu (Bob Wilson)
Original-Cc: gnu-win32 AT cygnus DOT com
In-Reply-To: <199704032002.PAA00930@cfawilson.harvard.edu> from "Bob Wilson" at Apr 3, 97 03:02:58 pm
X-Mailer: ELM [version 2.4 PL23]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

Bob Wilson wrote:
> 
> I have a program which ran correctly when compiled on a gnu-win32
> package from about a year ago, but is failing when compiled with 17.1
> beta.  The machine is running NT 3.51 and COM2 is connected to a
> microprocessor with only td, rd and ground connected.  The open:
> 
>         if ((comfd = open("com2", O_RDWR | O_TEXT)) <= 0) {
>             fprintf(stderr, "Cmd: Unable to open terminal\n");
>             exit(1);
>         }
> 
> hangs.

This should be fixed in beta 18.  I encountered similar problems trying to
talk to a serial port in a cygwin32-based gdb a little while ago.  The
solution was to rewrite some of the fhandler.cc code in the cygwin.dll
such that the classes make a little more sense.

The bottom line is that fhandler_base::open should not be checking
symlink/executable status of files, instead that code should be in
fhandler_disk_file::open which also does everything that
fhandler_base::open does.  Opening a com port is a fhandler_tty::open which
just defaults to the fhandler_base::open behavior.  This did the trick
for me.

-- 
Geoffrey Noer
noer AT cygnus DOT com
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019