Skip to content

Commit

Permalink
Fix union casting issue
Browse files Browse the repository at this point in the history
Can't cast to unions in C89
  • Loading branch information
Leont committed Apr 23, 2012
1 parent a5bda5e commit cb9cb83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@
Revision history for {{$dist->name}}

{{$NEXT}}
Fixed union casting issue

0.009 2011-12-10 17:25:37 Europe/Amsterdam
Renamed sigwait to the POSIX correct sigwaitinfo
Expand Down
4 changes: 3 additions & 1 deletion lib/POSIX/RT/Signal.xs
Expand Up @@ -132,9 +132,11 @@ sigqueue(pid, signal, number = 0)
int number;
PREINIT:
int ret, signo;
union sigval number_val;
CODE:
signo = (SvIOK(signal) || looks_like_number(signal)) && SvIV(signal) ? SvIV(signal) : whichsig(SvPV_nolen(signal));
ret = sigqueue(pid, signo, (union sigval) number);
number_val.sival_int = number;
ret = sigqueue(pid, signo, number_val);
if (ret == 0)
XSRETURN_YES;
else
Expand Down

0 comments on commit cb9cb83

Please sign in to comment.