mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 09:09:09 +02:00
* save/restore errno inside reenable_signal, because it can be called
from inside signal handlers git-svn-id: trunk@12997 -
This commit is contained in:
parent
ba10015c04
commit
1f6ec36064
@ -298,6 +298,7 @@ function reenable_signal(sig : longint) : boolean;
|
|||||||
var
|
var
|
||||||
e : TSigSet;
|
e : TSigSet;
|
||||||
i,j : byte;
|
i,j : byte;
|
||||||
|
olderrno: cint;
|
||||||
begin
|
begin
|
||||||
fillchar(e,sizeof(e),#0);
|
fillchar(e,sizeof(e),#0);
|
||||||
{ set is 1 based PM }
|
{ set is 1 based PM }
|
||||||
@ -305,8 +306,11 @@ begin
|
|||||||
i:=sig mod (sizeof(cuLong) * 8);
|
i:=sig mod (sizeof(cuLong) * 8);
|
||||||
j:=sig div (sizeof(cuLong) * 8);
|
j:=sig div (sizeof(cuLong) * 8);
|
||||||
e[j]:=1 shl i;
|
e[j]:=1 shl i;
|
||||||
|
{ this routine is called from a signal handler, so must not change errno }
|
||||||
|
olderrno:=geterrno;
|
||||||
fpsigprocmask(SIG_UNBLOCK,@e,nil);
|
fpsigprocmask(SIG_UNBLOCK,@e,nil);
|
||||||
reenable_signal:=geterrno=0;
|
reenable_signal:=geterrno=0;
|
||||||
|
seterrno(olderrno);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// signal handler is arch dependant due to processorexception to language
|
// signal handler is arch dependant due to processorexception to language
|
||||||
|
@ -153,6 +153,7 @@ function reenable_signal(sig : longint) : boolean;
|
|||||||
var
|
var
|
||||||
e,oe : TSigSet;
|
e,oe : TSigSet;
|
||||||
i,j : byte;
|
i,j : byte;
|
||||||
|
olderrno: cint;
|
||||||
begin
|
begin
|
||||||
fillchar(e,sizeof(e),#0);
|
fillchar(e,sizeof(e),#0);
|
||||||
fillchar(oe,sizeof(oe),#0);
|
fillchar(oe,sizeof(oe),#0);
|
||||||
@ -161,8 +162,11 @@ begin
|
|||||||
i:=sig mod 32;
|
i:=sig mod 32;
|
||||||
j:=sig div 32;
|
j:=sig div 32;
|
||||||
e[j]:=1 shl i;
|
e[j]:=1 shl i;
|
||||||
|
{ this routine is called from a signal handler, so must not change errno }
|
||||||
|
olderrno:=geterrno;
|
||||||
fpsigprocmask(SIG_UNBLOCK,@e,@oe);
|
fpsigprocmask(SIG_UNBLOCK,@e,@oe);
|
||||||
reenable_signal:=geterrno=0;
|
reenable_signal:=geterrno=0;
|
||||||
|
seterrno(olderrno);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$i sighnd.inc}
|
{$i sighnd.inc}
|
||||||
|
@ -298,6 +298,7 @@ function reenable_signal(sig : longint) : boolean;
|
|||||||
var
|
var
|
||||||
e : TSigSet;
|
e : TSigSet;
|
||||||
i,j : byte;
|
i,j : byte;
|
||||||
|
olderrno: cint;
|
||||||
begin
|
begin
|
||||||
fillchar(e,sizeof(e),#0);
|
fillchar(e,sizeof(e),#0);
|
||||||
{ set is 1 based PM }
|
{ set is 1 based PM }
|
||||||
@ -305,8 +306,11 @@ begin
|
|||||||
i:=sig mod (sizeof(cuLong) * 8);
|
i:=sig mod (sizeof(cuLong) * 8);
|
||||||
j:=sig div (sizeof(cuLong) * 8);
|
j:=sig div (sizeof(cuLong) * 8);
|
||||||
e[j]:=1 shl i;
|
e[j]:=1 shl i;
|
||||||
|
{ this routine is called from a signal handler, so must not change errno }
|
||||||
|
olderrno:=geterrno;
|
||||||
fpsigprocmask(SIG_UNBLOCK,@e,nil);
|
fpsigprocmask(SIG_UNBLOCK,@e,nil);
|
||||||
reenable_signal:=geterrno=0;
|
reenable_signal:=geterrno=0;
|
||||||
|
seterrno(olderrno);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// signal handler is arch dependant due to processorexception to language
|
// signal handler is arch dependant due to processorexception to language
|
||||||
@ -454,4 +458,4 @@ begin
|
|||||||
initunicodestringmanager;
|
initunicodestringmanager;
|
||||||
{$endif VER2_2}
|
{$endif VER2_2}
|
||||||
setupexecname;
|
setupexecname;
|
||||||
end.
|
end.
|
||||||
|
@ -216,6 +216,7 @@ function reenable_signal(sig : longint) : boolean;
|
|||||||
var
|
var
|
||||||
e : TSigSet;
|
e : TSigSet;
|
||||||
i,j : byte;
|
i,j : byte;
|
||||||
|
olderrno: cint;
|
||||||
begin
|
begin
|
||||||
fillchar(e,sizeof(e),#0);
|
fillchar(e,sizeof(e),#0);
|
||||||
{ set is 1 based PM }
|
{ set is 1 based PM }
|
||||||
@ -223,8 +224,11 @@ begin
|
|||||||
i:=sig mod (sizeof(cuLong) * 8);
|
i:=sig mod (sizeof(cuLong) * 8);
|
||||||
j:=sig div (sizeof(cuLong) * 8);
|
j:=sig div (sizeof(cuLong) * 8);
|
||||||
e[j]:=1 shl i;
|
e[j]:=1 shl i;
|
||||||
|
{ this routine is called from a signal handler, so must not change errno }
|
||||||
|
olderrno:=geterrno;
|
||||||
fpsigprocmask(SIG_UNBLOCK,@e,nil);
|
fpsigprocmask(SIG_UNBLOCK,@e,nil);
|
||||||
reenable_signal:=geterrno=0;
|
reenable_signal:=geterrno=0;
|
||||||
|
seterrno(olderrno);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// signal handler is arch dependant due to processorexception to language
|
// signal handler is arch dependant due to processorexception to language
|
||||||
|
@ -103,6 +103,7 @@ function reenable_signal(sig : longint) : boolean;
|
|||||||
var
|
var
|
||||||
e,oe : TSigSet;
|
e,oe : TSigSet;
|
||||||
i,j : byte;
|
i,j : byte;
|
||||||
|
olderrno: cint;
|
||||||
begin
|
begin
|
||||||
fillchar(e,sizeof(e),#0);
|
fillchar(e,sizeof(e),#0);
|
||||||
fillchar(oe,sizeof(oe),#0);
|
fillchar(oe,sizeof(oe),#0);
|
||||||
@ -111,8 +112,11 @@ begin
|
|||||||
i:=sig mod 32;
|
i:=sig mod 32;
|
||||||
j:=sig div 32;
|
j:=sig div 32;
|
||||||
e[j]:=1 shl i;
|
e[j]:=1 shl i;
|
||||||
|
{ this routine is called from a signal handler, so must not change errno }
|
||||||
|
olderrno:=geterrno;
|
||||||
fpsigprocmask(SIG_UNBLOCK,@e,@oe);
|
fpsigprocmask(SIG_UNBLOCK,@e,@oe);
|
||||||
reenable_signal:=geterrno=0;
|
reenable_signal:=geterrno=0;
|
||||||
|
seterrno(olderrno);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$i sighnd.inc}
|
{$i sighnd.inc}
|
||||||
|
Loading…
Reference in New Issue
Block a user