projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add an --install-signal-handlers=<yes|no> RTS flag; fixes trac #804
[ghc-hetmet.git]
/
rts
/
posix
/
Signals.c
diff --git
a/rts/posix/Signals.c
b/rts/posix/Signals.c
index
8645f1b
..
4ae22cd
100644
(file)
--- a/
rts/posix/Signals.c
+++ b/
rts/posix/Signals.c
@@
-17,6
+17,7
@@
#include "RtsUtils.h"
#include "RtsFlags.h"
#include "Prelude.h"
#include "RtsUtils.h"
#include "RtsFlags.h"
#include "Prelude.h"
+#include "ThrIOManager.h"
#ifdef alpha_HOST_ARCH
# if defined(linux_HOST_OS)
#ifdef alpha_HOST_ARCH
# if defined(linux_HOST_OS)
@@
-506,7
+507,7
@@
initDefaultHandlers()
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if (sigaction(SIGINT, &action, &oact) != 0) {
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if (sigaction(SIGINT, &action, &oact) != 0) {
- errorBelch("warning: failed to install SIGINT handler");
+ sysErrorBelch("warning: failed to install SIGINT handler");
}
#if defined(HAVE_SIGINTERRUPT)
}
#if defined(HAVE_SIGINTERRUPT)
@@
-518,7
+519,7
@@
initDefaultHandlers()
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if (sigaction(SIGCONT, &action, &oact) != 0) {
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if (sigaction(SIGCONT, &action, &oact) != 0) {
- errorBelch("warning: failed to install SIGCONT handler");
+ sysErrorBelch("warning: failed to install SIGCONT handler");
}
// install the SIGFPE handler
}
// install the SIGFPE handler
@@
-536,7
+537,7
@@
initDefaultHandlers()
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if (sigaction(SIGFPE, &action, &oact) != 0) {
sigemptyset(&action.sa_mask);
action.sa_flags = 0;
if (sigaction(SIGFPE, &action, &oact) != 0) {
- errorBelch("warning: failed to install SIGFPE handler");
+ sysErrorBelch("warning: failed to install SIGFPE handler");
}
#endif
}
#endif
@@
-545,4
+546,11
@@
initDefaultHandlers()
#endif
}
#endif
}
+void
+freeSignalHandlers(void) {
+ if (signal_handlers != NULL) {
+ stgFree(signal_handlers);
+ }
+}
+
#endif /* RTS_USER_SIGNALS */
#endif /* RTS_USER_SIGNALS */