From a0d3c309e4e9ea6aab9b058c2e3c68b8deff9c71 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 22 Nov 2002 20:51:13 +0000 Subject: * exceptions.cc (handle_sigsuspend): Force pending signal delivery before waiting for signals to happen. * signal.cc (sleep): Force pending signal delivery before sleeping. (usleep): Ditto. (signal): Force pending signal delivery before manipulating signal stuff. (sigprocmask): Ditto. (kill_worker): Ditto. (abort): Ditto. (sigaction): Ditto. * syscalls.cc (readv): Force pending signal delivery before I/O. (writev): Ditto. (open): Ditto. * net.cc: Ditto, throughout. * sigproc.cc (sig_dispatch_pending): Deliver any pending signals prior to returning. * tty.cc (tty::make_pipes): Increase pipe buffer size. --- winsup/cygwin/signal.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'winsup/cygwin/signal.cc') diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc index 010df9bf9..a23487fc3 100644 --- a/winsup/cygwin/signal.cc +++ b/winsup/cygwin/signal.cc @@ -43,6 +43,7 @@ set_sigcatchers (void (*oldsig) (int), void (*cursig) (int)) extern "C" _sig_func_ptr signal (int sig, _sig_func_ptr func) { + sig_dispatch_pending (0); _sig_func_ptr prev; /* check that sig is in right range */ @@ -69,6 +70,7 @@ extern "C" unsigned int sleep (unsigned int seconds) { int rc; + sig_dispatch_pending (0); sigframe thisframe (mainthread); DWORD ms, start_time, end_time; @@ -95,6 +97,7 @@ sleep (unsigned int seconds) extern "C" unsigned int usleep (unsigned int useconds) { + sig_dispatch_pending (0); syscall_printf ("usleep (%d)", useconds); WaitForSingleObject (signal_arrived, (useconds + 500) / 1000); syscall_printf ("0 = usleep (%d)", useconds); @@ -104,6 +107,7 @@ usleep (unsigned int useconds) extern "C" int sigprocmask (int sig, const sigset_t *set, sigset_t *oldset) { + sig_dispatch_pending (0); /* check that sig is in right range */ if (sig < 0 || sig >= NSIG) { @@ -143,6 +147,8 @@ sigprocmask (int sig, const sigset_t *set, sigset_t *oldset) static int kill_worker (pid_t pid, int sig) { + sig_dispatch_pending (0); + int res = 0; pinfo dest (pid); BOOL sendSIGCONT; @@ -261,6 +267,7 @@ killpg (pid_t pgrp, int sig) extern "C" void abort (void) { + sig_dispatch_pending (0); sigframe thisframe (mainthread); /* Flush all streams as per SUSv2. From my reading of this document, this isn't strictly correct. @@ -286,6 +293,7 @@ abort (void) extern "C" int sigaction (int sig, const struct sigaction *newact, struct sigaction *oldact) { + sig_dispatch_pending (0); sigproc_printf ("signal %d, newact %p, oldact %p", sig, newact, oldact); /* check that sig is in right range */ if (sig < 0 || sig >= NSIG) -- cgit v1.2.3