* Fix bug ID #32172, correct installation of sighandlers

git-svn-id: trunk@36752 -
This commit is contained in:
michael 2017-07-20 11:39:16 +00:00
parent d975ec6d0b
commit b34ff11803

View File

@ -218,14 +218,22 @@ end;
Procedure SysInitDaemonApp;
Var
old,new : SigactionRec;
Procedure installhandler(aSig : Longint);
Var
old,new : SigactionRec;
begin
FillChar(New,SizeOf(Sigactionrec),#0);
FillChar(Old,SizeOf(Sigactionrec),#0);
New.sa_handler:=@DoShutDown;
fpSigaction(aSig,@New,@Old);
end;
begin
New.sa_handler:=@DoShutDown;
fpSigaction(SIGQUIT,@New,@Old);
fpSigaction(SIGTERM,@New,@Old);
fpSigaction(SIGINT,@New,@Old);
InstallHandler(SIGQUIT);
InstallHandler(SIGTERM);
InstallHandler(SIGINT);
end;