* fixed checking the address of installed signal handlers on aix and

linux/ppc64 (have to look past the function descriptors)

git-svn-id: trunk@20820 -
This commit is contained in:
Jonas Maebe 2012-04-11 18:04:50 +00:00
parent 6f02f47e59
commit 9a1cd0ec4c

View File

@ -106,7 +106,14 @@ function InternalInquireSignal(RtlSigNum: Integer; out act: SigActionRec; fromin
if not frominit then
begin
{ check whether the installed signal handler is still ours }
{$if not defined(aix) and (not defined(linux) or not defined(cpupowerpc64))}
if (pointer(act.sa_handler)=pointer(@defaultsighandler)) then
{$else}
{ on aix and linux/ppc64, procedure addresses are actually
descriptors -> check whether the code addresses inside the
descriptors match, rather than the descriptors themselves }
if (ppointer(act.sa_handler)^=ppointer(@defaultsighandler)^) then
{$endif}
result:=ssHooked
else
result:=ssOverridden;
@ -121,7 +128,11 @@ function InternalInquireSignal(RtlSigNum: Integer; out act: SigActionRec; fromin
{ program -> signals have been hooked by system init code }
if (byte(RtlSigNum) in [RTL_SIGFPE,RTL_SIGSEGV,RTL_SIGILL,RTL_SIGBUS]) then
begin
{$if not defined(aix) and (not defined(linux) or not defined(cpupowerpc64))}
if (pointer(act.sa_handler)=pointer(@defaultsighandler)) then
{$else}
if (ppointer(act.sa_handler)^=ppointer(@defaultsighandler)^) then
{$endif}
result:=ssHooked
else
result:=ssOverridden;