mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 00:39:15 +02:00
Use Florian's suggestion to avoid IOStatus 5 errors in ExecuteProcess using process unit
git-svn-id: trunk@32975 -
This commit is contained in:
parent
716b3082e9
commit
7f0b676af1
@ -1084,7 +1084,6 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
result := -1;
|
result := -1;
|
||||||
counter:=0;
|
|
||||||
TerminateSentCount:=0;
|
TerminateSentCount:=0;
|
||||||
|
|
||||||
P := TProcess.Create(nil);
|
P := TProcess.Create(nil);
|
||||||
@ -1094,6 +1093,13 @@ begin
|
|||||||
P.InheritHandles:=(execinheritshandles in flags);
|
P.InheritHandles:=(execinheritshandles in flags);
|
||||||
|
|
||||||
P.Execute;
|
P.Execute;
|
||||||
|
{$ifdef Windows}
|
||||||
|
WaitForSingleObject(P.ProcessHandle,max_count);
|
||||||
|
counter:=max_count;
|
||||||
|
{$else not Windows}
|
||||||
|
counter:=0;
|
||||||
|
{$endif not Windows}
|
||||||
|
|
||||||
while P.Running do
|
while P.Running do
|
||||||
begin
|
begin
|
||||||
if counter>max_count then
|
if counter>max_count then
|
||||||
|
Loading…
Reference in New Issue
Block a user