Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-05-05 23:43:04 +0400
committerCorinna Vinschen <corinna@vinschen.de>2011-05-05 23:43:04 +0400
commitd8ff96389f6beb97defd285b224fead3f37398f5 (patch)
tree5246416567fc69e322ca413e0d0c11db29dbe607 /winsup/cygwin/fhandler_console.cc
parent23db0a41d8b178d6f3d2297834b28e015346bd43 (diff)
* pinfo.h (class push_process_state): New class to push a process state
flag temporarily into myself->process_state. * fhandler_console.cc (fhandler_console::read): Add push_process_state handler. (fhandler_console::write): Call bg_check from here. Add push_process_state handler. * fhandler_tty.cc (fhandler_tty_slave::write): Ditto. (fhandler_tty_slave::read): Ditto. (fhandler_pty_master::write): Ditto. (fhandler_pty_master::read): Ditto. * syscalls.cc (readv): Remove bg_check call and setting process state. (writev): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r--winsup/cygwin/fhandler_console.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc
index 8a5ff1830..b33b14dee 100644
--- a/winsup/cygwin/fhandler_console.cc
+++ b/winsup/cygwin/fhandler_console.cc
@@ -247,6 +247,8 @@ fhandler_console::mouse_aware (MOUSE_EVENT_RECORD& mouse_event)
void __stdcall
fhandler_console::read (void *pv, size_t& buflen)
{
+ push_process_state process_state (PID_TTYIN);
+
HANDLE h = get_io_handle ();
#define buf ((char *) pv)
@@ -288,6 +290,7 @@ restart:
goto restart;
goto sig_exit;
case WAIT_OBJECT_0 + 2:
+ process_state.pop ();
pthread::static_cancel_self ();
/*NOTREACHED*/
case WAIT_TIMEOUT:
@@ -1814,6 +1817,12 @@ do_print:
ssize_t __stdcall
fhandler_console::write (const void *vsrc, size_t len)
{
+ bg_check_types bg = bg_check (SIGTTOU);
+ if (bg <= bg_eof)
+ return (ssize_t) bg;
+
+ push_process_state process_state (PID_TTYOU);
+
/* Run and check for ansi sequences */
unsigned const char *src = (unsigned char *) vsrc;
unsigned const char *end = src + len;