public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Jim Balter <jqb@netcom.com>
To: Bob Wilson <rwilson@cfawilson.harvard.edu>
Cc: gnu-win32@cygnus.com
Subject: Re: Opening COM2
Date: Thu, 03 Apr 1997 22:44:00 -0000	[thread overview]
Message-ID: <33446DD3.1CF5@netcom.com> (raw)
In-Reply-To: <199704032002.PAA00930@cfawilson.harvard.edu>

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.  It doesn't help to tie the modem control lines high, but if I
> generate a few characters on the rd line, the open completes.  In no
> case is there an error return.
> 
> I have looked for this problem in the FAQ and looked for archives of
> this mailing list, but both searches failed.
> 
> Can anyone help?

Marko Kohtala posted this patch to fix the problem the other day
(I haven't tried it and am not vouching for it):

diff -up b17.1/winsup/path.cc\~ b17.1/winsup/path.cc
--- b17.1/winsup/path.cc~       Wed Dec  4 05:23:01 1996
+++ b17.1/winsup/path.cc        Tue Apr  1 17:14:21 1997
@@ -1056,7 +1056,14 @@ symlink_check (const char *path, char *b
       char cookie_buf[sizeof (SYMLINK_COOKIE) - 1];
       DWORD done;
 
-      if (! ReadFile (h, cookie_buf, sizeof (cookie_buf), &done, 0))
+      if ((GetFileType (h) & ~FILE_TYPE_REMOVE) != FILE_TYPE_DISK)
+       {
+         /* It is not a disk file, can not be a symlink */
+         *syml = 0;
+         *exec = 0;
+         res = 0;
+       }
+      else if (! ReadFile (h, cookie_buf, sizeof (cookie_buf), &done,
0))
        {
          set_errno (EIO);
        }



--
<J Q B>
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

  reply	other threads:[~1997-04-03 22:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-03 13:20 Bob Wilson
1997-04-03 22:44 ` Jim Balter [this message]
1997-04-03 23:05 ` Fergus Henderson
1997-04-07 15:27 ` Geoffrey Noer
1997-04-07  8:52 David Fiddes
1997-05-14 22:52 Markus Maeder
1997-05-15 14:19 Gary Liddle
1997-05-15 23:48 Markus Maeder

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=33446DD3.1CF5@netcom.com \
    --to=jqb@netcom.com \
    --cc=gnu-win32@cygnus.com \
    --cc=rwilson@cfawilson.harvard.edu \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).