* 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.
This commit is contained in:
Christopher Faylor
2005-06-30 02:52:14 +00:00
parent d573a471af
commit 5b3e1f7358
9 changed files with 87 additions and 20 deletions

View File

@ -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