* Patch from #18617 Forkevent from Seth Grover.

git-svn-id: trunk@16822 -
This commit is contained in:
marco 2011-01-27 19:15:10 +00:00
parent 1b8372d750
commit a14b0d020e
2 changed files with 15 additions and 0 deletions

View File

@ -41,6 +41,10 @@ Type
Type
{$ifdef UNIX}
TProcessForkEvent = procedure;
{$endif UNIX}
TProcess = Class (TComponent)
Private
FProcessOptions : TProcessOptions;
@ -58,6 +62,9 @@ Type
FEnvironment : Tstrings;
FShowWindow : TShowWindowOptions;
FInherithandles : Boolean;
{$ifdef UNIX}
FForkEvent : TProcessForkEvent;
{$endif UNIX}
FProcessPriority : TProcessPriority;
dwXCountchars,
dwXSize,
@ -113,6 +120,9 @@ Type
Property Stderr : TinputPipeStream Read FStderrStream;
Property ExitStatus : Integer Read GetExitStatus;
Property InheritHandles : Boolean Read FInheritHandles Write FInheritHandles;
{$ifdef UNIX}
property OnForkEvent : TProcessForkEvent Read FForkEvent Write FForkEvent;
{$endif UNIX}
Published
Property Active : Boolean Read GetRunning Write SetActive;
Property ApplicationName : String Read FApplicationName Write SetApplicationName;
@ -163,6 +173,9 @@ begin
FProcessPriority:=ppNormal;
FShowWindow:=swoNone;
FInheritHandles:=True;
{$ifdef UNIX}
FForkEvent:=nil;
{$endif UNIX}
FEnvironment:=TStringList.Create;
end;

View File

@ -360,6 +360,8 @@ begin
safefpdup2(fd,1);
safefpdup2(fd,2);
end;
if Assigned(FForkEvent) then
FForkEvent;
if (poRunSuspended in Options) then
sigraise(SIGSTOP);
if FEnv<>Nil then