+2002-12-19 Steve Osborn <bub@io.com>
+
+ * fhandler.h (line_edit_status): Add a new element.
+ * fhandler_termios.cc (fhandler_termios::line_edit): After
+ accept_input, handle both potential error condition and pipe full
+ conditions.
+ * fhandler_tty.cc (fhandler_pty_master::accept_input): Return -1 on
+ error.
+ (fhandler_pty_master::write): Handle pipe full condition.
+
2002-12-16 Steve Osborn <bub@io.com>
Christopher Faylor <cgf@redhat.com>
line_edit_signalled = -1,
line_edit_ok = 0,
line_edit_input_done = 1,
- line_edit_error = 2
+ line_edit_error = 2,
+ line_edit_pipe_full = 3
};
enum bg_check_types
put_readahead (c);
if (!iscanon || always_accept || input_done)
{
- if (!accept_input ())
+ int status = accept_input ();
+ if (status != 1)
{
- ret = line_edit_error;
+ ret = status ? line_edit_error : line_edit_pipe_full;
eat_readahead (1);
break;
}
{
debug_printf ("error writing to pipe %E");
get_ttyp ()->read_retval = -1;
+ ret = -1;
}
else
{
int
fhandler_pty_master::write (const void *ptr, size_t len)
{
- size_t i;
+ int i;
char *p = (char *) ptr;
- for (i=0; i<len; i++)
- if (line_edit (p++, 1) == line_edit_error)
+ for (i=0; i < (int) len; i++)
+ {
+ line_edit_status status = line_edit (p++, 1);
+ if (status == line_edit_ok || status == line_edit_input_done)
+ continue;
+ if (status != line_edit_pipe_full)
+ i = -1;
break;
+ }
return i;
}