Extra precaution while redirecting STDIO in unix
This commit is contained in:
parent
e6df923fe6
commit
29b90c351f
|
@ -135,12 +135,10 @@ Begin
|
||||||
|
|
||||||
Proc.Execute;
|
Proc.Execute;
|
||||||
|
|
||||||
While Proc.Running Do Begin
|
While Proc.Running Or (Proc.Output.NumBytesAvailable > 0) Do Begin
|
||||||
If Proc.Output.NumBytesAvailable > 0 Then Begin
|
If Proc.Output.NumBytesAvailable > 0 Then Begin
|
||||||
While Proc.Output.NumBytesAvailable > 0 Do Begin
|
|
||||||
bRead := Proc.Output.Read(Buffer, TIOBufferSize);
|
bRead := Proc.Output.Read(Buffer, TIOBufferSize);
|
||||||
Client.WriteBufEscaped (Buffer, bRead);
|
Client.WriteBufEscaped (Buffer, bRead);
|
||||||
End;
|
|
||||||
End Else
|
End Else
|
||||||
If Client.DataWaiting Then Begin
|
If Client.DataWaiting Then Begin
|
||||||
bWrite := Client.ReadBuf(Buffer, TIOBufferSize);
|
bWrite := Client.ReadBuf(Buffer, TIOBufferSize);
|
||||||
|
|
Loading…
Reference in New Issue