diff options
author | Christopher Faylor <me@cgf.cx> | 2002-12-05 16:24:52 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-12-05 16:24:52 +0000 |
commit | 49dd6fc61e991a533ae3f1167d48bb07b3391311 (patch) | |
tree | add58e9624eafa48ed31834cdfade456a4e0550f /winsup/cygwin/fhandler_tty.cc | |
parent | 94d815b251f6e5743f629aea73406fd9937feca3 (diff) | |
download | cygnal-49dd6fc61e991a533ae3f1167d48bb07b3391311.tar.gz cygnal-49dd6fc61e991a533ae3f1167d48bb07b3391311.tar.bz2 cygnal-49dd6fc61e991a533ae3f1167d48bb07b3391311.zip |
* fhandler.h (fhandler_termios::line_edit): Change return from an int to an
enum to allow the function to return an error.
* fhandler_console.cc (fhandler_console::read): Update the line_edit call to
use the new enum.
* fhandler_termios.cc (fhandler_termios::line_edit): Change return from an int
to an enum to allow the function to return an error. Put put_readahead call
before doecho for future patch.
* fhandler_tty.cc (fhandler_pty_master::write): Change to call line_edit one
character at a time, and stop if an error occurs.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index dc0f0fceb..3b47f567a 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -167,7 +167,7 @@ fhandler_pty_master::accept_input () get_ttyp ()->read_retval = -1; break; } - else + else get_ttyp ()->read_retval = 1; p += written; @@ -1077,8 +1077,12 @@ fhandler_pty_master::close () int fhandler_pty_master::write (const void *ptr, size_t len) { - (void) line_edit ((char *) ptr, len); - return len; + size_t i; + char *p = (char *) ptr; + for (i=0; i<len; i++) + if (line_edit (p++, 1) == line_edit_error) + break; + return i; } int __stdcall |