projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cd2773d
)
Fix signal segfaults on Solaris (#3790)
author
Simon Marlow
<marlowsd@gmail.com>
Tue, 26 Jan 2010 15:54:49 +0000
(15:54 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Tue, 26 Jan 2010 15:54:49 +0000
(15:54 +0000)
rts/posix/Signals.c
patch
|
blob
|
history
diff --git
a/rts/posix/Signals.c
b/rts/posix/Signals.c
index
98115ba
..
4bb1255
100644
(file)
--- 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)
{