This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Possible bug in fhandler_pty_master::process_slave_output()
- To: <Cygwin at Sourceware dot Cygnus dot Com>
- Subject: Possible bug in fhandler_pty_master::process_slave_output()
- From: "Andrej Borsenkow" <Andrej dot Borsenkow at mow dot siemens dot ru>
- Date: Thu, 3 Aug 2000 14:24:13 +0400
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@sourceware.cygnus.com