Possible bug in fhandler_pty_master::process_slave_output()

Andrej Borsenkow Andrej.Borsenkow@mow.siemens.ru
Thu Aug 3 03:24:00 GMT 2000


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



More information about the Cygwin mailing list