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>2001-01-17 17:57:09 +0300
committerChristopher Faylor <me@cgf.cx>2001-01-17 17:57:09 +0300
commita7cde2b98a658522f552a7ac7ae0a9ef07981e0a (patch)
tree09134d68cc17eab1ebd6c4d81363c189f70ddf7c /winsup/cygwin/fhandler_termios.cc
parentcb503978ab5119740bc5e796344db6a5d0e6bcb5 (diff)
* autoload.cc (LoadDLLinitfunc): Remove debugging statement.
* exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to earlier in interrupt. ((interrupt_setup): i.e., here. (sig_handle): Don't queue multiple SIGSTOPS. * fhandler.h (bg_check_types): Enumerate return value of bg_check for clarity. * signal.cc (kill_pgrp): Minor cleanup. * fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type for function return. Don't raise signal if a signal is already queued. * fhandler_console.cc (fhandler_console::read): Use enumerated return type for bg_check. * select.cc: Ditto, throughout. * read.cc: Ditto, throughout. * termios.cc: Ditto, throughout. (_read): YA interrupt detect simplification. * wait.cc (wait4): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_termios.cc')
-rw-r--r--winsup/cygwin/fhandler_termios.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc
index 014e7d104..1d0491379 100644
--- a/winsup/cygwin/fhandler_termios.cc
+++ b/winsup/cygwin/fhandler_termios.cc
@@ -1,6 +1,6 @@
/* fhandler_termios.cc
- Copyright 1996, 1997, 1998 Cygnus Solutions.
+ Copyright 1999, 2000, 2001 Red Hat, Inc.
This file is part of Cygwin.
@@ -107,13 +107,13 @@ fhandler_termios::set_ctty (int ttynum, int flags)
}
}
-int
+bg_check_types
fhandler_termios::bg_check (int sig)
{
if (!myself->pgid || tc->getpgid () == myself->pgid ||
myself->ctty != tc->ntty ||
((sig == SIGTTOU) && !(tc->ti.c_lflag & TOSTOP)))
- return 1;
+ return bg_ok;
if (sig < 0)
sig = -sig;
@@ -128,7 +128,7 @@ fhandler_termios::bg_check (int sig)
from reallocating this pty. I think this is the case
which is handled by unlockpt on a Unix system. */
termios_printf ("closed by master");
- return 0;
+ return bg_eof;
}
/* If the process group is no more or if process is ignoring or blocks 'sig',
@@ -143,16 +143,19 @@ fhandler_termios::bg_check (int sig)
else if (!sigs_ignored)
/* nothing */;
else if (sig == SIGTTOU)
- return 1; /* Just allow the output */
+ return bg_ok; /* Just allow the output */
else
goto setEIO; /* This is an output error */
- _raise (sig);
- return 1;
+ /* Don't raise a SIGTT* signal if we have already been interrupted
+ by another signal. */
+ if (WaitForSingleObject (signal_arrived, 0) != WAIT_OBJECT_0)
+ _raise (sig);
+ return bg_signalled;
setEIO:
set_errno (EIO);
- return -1;
+ return bg_error;
}
#define set_input_done(x) input_done = input_done || (x)