Mail Archives: cygwin-developers/1999/03/31/01:51:09
On Tue, Mar 30, 1999 at 11:48:12AM -0500, Sergey Okhapkin wrote:
>
>
>>>The problem with login via telnetd remains the same :(
>>>
>>>After typing the username and LF (or CR), the connection is lost.
>>>
>>
>>
>>fhandler_tty_slave::read() always returns EOF because
>>fhandler_pty_master::write() doesn't set ttyp->read_retval to a number of
>>chars written.
>
>pty support is broken now because of a mix of two _very different_ things in
>code - tc and ttyp.
Actually they aren't that different but that insight is much
appreciated. I didn't get this in in time for the snapshot but I have,
at least temporarily, gotten remote telnet logins working by simply
assigning tc = ttyp, where appropriate.
You all should see this on Thursday or, if you're interested, the patch is
below.
-chris
Index: fhandler.h
===================================================================
RCS file: /cvs/cvsfiles/devo/winsup/fhandler.h,v
retrieving revision 1.81
diff -u -p -r1.81 fhandler.h
--- fhandler.h 1999/03/28 21:58:58 1.81
+++ fhandler.h 1999/03/31 06:44:27
@@ -579,7 +579,7 @@ public:
fhandler_termios (dev, name, unit, cygwin_shared->tty[unit])
{
ttynum = unit;
- ttyp = cygwin_shared->tty[unit];
+ tc = ttyp = cygwin_shared->tty[unit];
}
HANDLE output_done_event; // Raised by master when tty's output buffer
// written. Write status in tty::write_retval.
Index: fhandler_tty.cc
===================================================================
RCS file: /cvs/cvsfiles/devo/winsup/fhandler_tty.cc,v
retrieving revision 1.19
diff -u -p -r1.19 fhandler_tty.cc
--- fhandler_tty.cc 1999/03/30 03:50:38 1.19
+++ fhandler_tty.cc 1999/03/31 06:44:28
@@ -56,7 +56,7 @@ fhandler_tty_master::init (int ntty)
return -1;
}
- ttyp = cygwin_shared->tty[ntty];
+ tc = ttyp = cygwin_shared->tty[ntty];
ttynum = ntty;
console->init (err, GENERIC_READ | GENERIC_WRITE, O_BINARY);
@@ -69,7 +69,9 @@ fhandler_tty_master::init (int ntty)
ti.c_iflag = INLCR;
ti.c_lflag = ECHO | ICANON | ISIG;
+#if 0 /* FIXME: Should be handled by console->init above */
console->tcsetattr (0, &ti);
+#endif
ttyp->common_init (this);
@@ -695,7 +697,7 @@ fhandler_tty_common::dup (fhandler_base
{
fhandler_tty_slave *fts = (fhandler_tty_slave *) child;
fts->ttynum = ttynum;
- fts->ttyp = ttyp;
+ fts->tc = fts->ttyp = ttyp;
return 0;
}
Index: tty.cc
===================================================================
RCS file: /cvs/cvsfiles/devo/winsup/tty.cc,v
retrieving revision 1.29
diff -u -p -r1.29 tty.cc
--- tty.cc 1999/03/25 03:22:48 1.29
+++ tty.cc 1999/03/31 06:44:29
@@ -339,7 +339,7 @@ tty::make_pipes (fhandler_pty_master *pt
BOOL
tty::common_init (fhandler_pty_master *ptym)
{
- ptym->ttyp = this;
+ ptym->tc = ptym->ttyp = this;
if (!make_pipes (ptym))
return FALSE;
ptym->neednl_ = 0;
- Raw text -