delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/08/03/06:25:05

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Envelope-Sender-Is: Andrej DOT Borsenkow AT mow DOT siemens DOT ru (at relayer goliath.siemens.de)
From: "Andrej Borsenkow" <Andrej DOT Borsenkow AT mow DOT siemens DOT ru>
To: <Cygwin AT Sourceware DOT Cygnus DOT Com>
Subject: Possible bug in fhandler_pty_master::process_slave_output()
Date: Thu, 3 Aug 2000 14:24:13 +0400
Message-ID: <000701bffd34$f82da190$21c9ca95@mow.siemens.ru>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

If need_nl is not zero, we get

  int rc = 0;
     ...
  if (need_nl)
    {
      /* We need to return a left over \n character, resulting from
         \r\n conversion.  Note that we already checked for FLUSHO and
         OutputStopped at the time that we read the character, so we
         don't check again here.  */
      buf[0] = '\n';
      need_nl = 0;
      goto out;
    }
     ...
out:
  termios_printf ("returning %d", rc);
  return rc;

That is, in this case instead of 1 function returns 0, that of course means
EOF. That corresponds to symptoms I've seen here - after every line read from
master side I get a read() with size 0. Next read() returns next character(s)
from the next line.

This opens up another question. It means, that somewhere between slave and
master side NL is converted into CR-NL. Program writes into slave side
"foo\n" - and reading from master side I get "foo\r" followed by EOF. I
already tried to set binary mode for both slave and master using setmode() but
without any luck.

Do I need some special initialization for pseudo terminals?

I'm currently running cygwin-1.1.3-1 prerelease; source are from CVS on Kuly,
30th. The revision of fhandler_tty.cc is 1.10 for HEAD.

-andrej

Have a nice DOS!
B >>


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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