|
@@ -806,6 +806,7 @@ var
|
|
|
|
|
|
begin
|
|
begin
|
|
Result:=false;
|
|
Result:=false;
|
|
|
|
+ IOstatus:=0;
|
|
P := TProcess.Create(nil);
|
|
P := TProcess.Create(nil);
|
|
try
|
|
try
|
|
P.CommandLine:=Progname + ' ' + ComLine;
|
|
P.CommandLine:=Progname + ' ' + ComLine;
|
|
@@ -815,10 +816,20 @@ begin
|
|
P.Options:=P.options+[poStdErrToOutput]
|
|
P.Options:=P.options+[poStdErrToOutput]
|
|
else
|
|
else
|
|
P.ErrorDescriptor.FileName:=RedirStdErr;
|
|
P.ErrorDescriptor.FileName:=RedirStdErr;
|
|
- P.Execute;
|
|
|
|
- Result:=P.WaitOnExit(max_count);
|
|
|
|
|
|
+ try
|
|
|
|
+ P.Execute;
|
|
|
|
+ Result:=P.WaitOnExit(max_count);
|
|
|
|
+ except
|
|
|
|
+ on e : exception do
|
|
|
|
+ begin
|
|
|
|
+ IOStatus:=2;
|
|
|
|
+ writeln(stderr,'ExecuteRedir generated an exception: ',E.Message);
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
if Result then
|
|
if Result then
|
|
ExecuteResult:=P.ExitCode
|
|
ExecuteResult:=P.ExitCode
|
|
|
|
+ else if (IOStatus<>0) then
|
|
|
|
+ ExecuteResult:=IOStatus*1000
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
Writeln(stderr,'Terminate requested for ',Progname,' ',ComLine);
|
|
Writeln(stderr,'Terminate requested for ',Progname,' ',ComLine);
|