summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-12-16 23:28:03 +0000
committerChristopher Faylor <me@cgf.cx>2003-12-16 23:28:03 +0000
commit1ed95be609c9af283fe0c1b21b760b3abc0792f8 (patch)
treef66a56ac47a1bcf0e3fc9090cb96da31f51d0608 /winsup/cygwin/syscalls.cc
parent0c3966ac4e4452bf2c38385291dfefc70b3f53d5 (diff)
downloadcygnal-1ed95be609c9af283fe0c1b21b760b3abc0792f8.tar.gz
cygnal-1ed95be609c9af283fe0c1b21b760b3abc0792f8.tar.bz2
cygnal-1ed95be609c9af283fe0c1b21b760b3abc0792f8.zip
* exceptions.cc (set_signal_mask): Report on input argument rather than
getsigmask. * fhandler.h (fhandler_base): Make friends with close_all_files. * pinfo.cc (_pinfo::set_ctty): Add more debugging. * sigproc.cc (proc_can_be_signalled): Detect state when signal handler thread is gone in target process as an EPERM situation. Set errno to ESRCH if process doesn't exist. (sigproc_terminate): Set sendsig to illegal value when closed. (sig_send): Rely on proc_can_be_signalled setting the proper errno. * syscalls.cc (close_all_files): Detect when all ttys are closed prior to calling close_all_files. The ctty needs to be closed explicitly in this case.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 2bb701d8e..cf60e11f4 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -91,14 +91,20 @@ close_all_files (void)
if (cygheap->ctty)
{
- debug_printf ("decrementing ctty usecount");
- cygheap->ctty->usecount--;
+ if (cygheap->ctty->usecount == 1)
+ cygheap->ctty->close ();
+ else
+ cygheap->ctty->usecount--;
+ debug_printf ("ctty usecount %d", cygheap->ctty->archetype->usecount);
}
fhandler_base *fh;
for (int i = 0; i < (int) cygheap->fdtab.size; i++)
if ((fh = cygheap->fdtab[i]) != NULL)
{
+#ifdef DEBUGGING
+ debug_printf ("closing fd %d", i);
+#endif
fh->close ();
cygheap->fdtab.release (i);
}