summaryrefslogtreecommitdiff
path: root/rts/posix/Signals.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-01-26 15:54:49 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-01-26 15:54:49 +0000
commitaa2e8180ac75c2caec57e6a47083a5bb7c82373f (patch)
treec0c694c4a48be6a4945dc8814dab6a0d89067516 /rts/posix/Signals.c
parentcd2773d8030b1c978bfda6a30f396592a4a94be4 (diff)
downloadhaskell-aa2e8180ac75c2caec57e6a47083a5bb7c82373f.tar.gz
Fix signal segfaults on Solaris (#3790)
Diffstat (limited to 'rts/posix/Signals.c')
-rw-r--r--rts/posix/Signals.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c
index 98115bac8a..4bb1255dac 100644
--- a/rts/posix/Signals.c
+++ b/rts/posix/Signals.c
@@ -183,7 +183,14 @@ generic_handler(int sig USED_IF_THREADS,
int r;
buf[0] = sig;
- memcpy(buf+1, info, sizeof(siginfo_t));
+
+ if (info == NULL) {
+ // info may be NULL on Solaris (see #3790)
+ memset(buf+1, 0, sizeof(siginfo_t));
+ } else {
+ memcpy(buf+1, info, sizeof(siginfo_t));
+ }
+
r = write(io_manager_pipe, buf, sizeof(siginfo_t)+1);
if (r == -1 && errno == EAGAIN)
{