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:
authorChristopher Faylor <me@cgf.cx>2005-06-30 06:52:14 +0400
committerChristopher Faylor <me@cgf.cx>2005-06-30 06:52:14 +0400
commit5b3e1f7358338fa4fe7223fb34df9a06fda7e97c (patch)
tree8627ea790d932d24c96ba83d8cfac61d59560126 /winsup/cygwin/fhandler_termios.cc
parentd573a471af3908faf346e61d51e04944ca33a38e (diff)
* cygerrno.h: Make multi-inclusion safe.
* fhandler_termios.cc (fhandler_termios::tcsetpgrp): Deal with EINTR. * dcrt0.cc (dll_crt0_0): Accommodate init_console_handler argument change. * winsup.h: Ditto. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * exceptions.cc (init_console_handler): Ditto. Ignore console events if we're not attached to a terminal. * fhandler_tty.cc (fhandler_tty_slave::open): Ditto. * wincap.cc: Implement has_null_console_handler_routine throughout. * wincap.h: Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_termios.cc')
-rw-r--r--winsup/cygwin/fhandler_termios.cc27
1 files changed, 25 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index f54a08c0e..640d5dd5e 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -21,6 +21,7 @@ details. */
#include "pinfo.h"
#include "tty.h"
#include "sys/cygwin.h"
+#include "cygtls.h"
/* Common functions shared by tty/console */
@@ -72,8 +73,30 @@ fhandler_termios::tcsetpgrp (const pid_t pgid)
set_errno (EPERM);
return -1;
}
- tc->setpgid (pgid);
- return 0;
+ int res;
+ while (1)
+ {
+ res = bg_check (-SIGTTOU);
+
+ switch (res)
+ {
+ case bg_ok:
+ tc->setpgid (pgid);
+ init_console_handler (!!is_console ());
+ res = 0;
+ break;
+ case bg_signalled:
+ if (_my_tls.call_signal_handler ())
+ continue;
+ set_errno (EINTR);
+ /* fall through intentionally */
+ default:
+ res = -1;
+ break;
+ }
+ break;
+ }
+ return res;
}
int