* fhandler.h (fhandler_termios::line_edit): Add parameter to return

written bytes.
	* fhandler_termios.cc (fhandler_termios::tcinit): Fix formatting.
	(fhandler_termios::line_edit): Return bytes actually written.  Write
	in 32 byte chunks in non-canonical mode to reduce number of WriteFile
	calls.  Don't just eat unwritten bytes in case of an error condition.
	Especially, don't report them back to the caller as written.
	* fhandler_tty.cc (fhandler_pty_slave::read): Disable code reducing
	the number of bytes read from the pipe to vmin.  Add comment.
	(fhandler_pty_master::write): Convert ret to ssize_t type.  Just call
	line_edit once, not in a loop once for each byte.  Return bytes written
	as returned by line_edit.
This commit is contained in:
Corinna Vinschen
2014-11-13 18:37:15 +00:00
parent d544f256d1
commit 73742508fc
4 changed files with 54 additions and 23 deletions

View File

@@ -1204,7 +1204,8 @@ class fhandler_termios: public fhandler_base
need_fork_fixup (true);
}
HANDLE& get_output_handle () { return output_handle; }
line_edit_status line_edit (const char *rptr, int nread, termios&);
line_edit_status line_edit (const char *rptr, size_t nread, termios&,
ssize_t *bytes_read = NULL);
void set_output_handle (HANDLE h) { output_handle = h; }
void tcinit (bool force);
bool is_tty () const { return true; }