summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 8a65f355b..75ad01c67 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -18,7 +18,6 @@ details. */
#include "sigproc.h"
#include "pinfo.h"
#include "cygerrno.h"
-#include "thread.h"
#include "perthread.h"
#include "shared_info.h"
#include "perprocess.h"
@@ -639,7 +638,7 @@ interrupt_now (CONTEXT *ctx, int sig, struct sigaction& siga, void *handler)
SetThreadContext (myself->getthread2signal (), ctx); /* Restart the thread */
}
-void __cdecl
+void __stdcall
signal_fixup_after_fork ()
{
if (!sigsave.sig)
@@ -653,6 +652,18 @@ signal_fixup_after_fork ()
}
}
+void __stdcall
+signal_fixup_after_exec (bool isspawn)
+{
+ /* Set up child's signal handlers */
+ for (int i = 0; i < NSIG; i++)
+ {
+ myself->getsig(i).sa_mask = 0;
+ if (myself->getsig(i).sa_handler != SIG_IGN || isspawn)
+ myself->getsig(i).sa_handler = SIG_DFL;
+ }
+}
+
static int
interrupt_on_return (DWORD ebp, int sig, struct sigaction& siga, void *handler)
{
@@ -775,7 +786,7 @@ call_handler (int sig, struct sigaction& siga, void *handler)
}
next:
- if (hExeced != NULL || (!using_mainthread_frame && interruptible (cx.Eip)))
+ if (!using_mainthread_frame && interruptible (cx.Eip))
interrupt_now (&cx, sig, siga, handler);
else if (!interrupt_on_return (ebp, sig, siga, handler))
{