Some code was unreachable due to a LongWord declaration
This commit is contained in:
parent
3a5e73f312
commit
b1f05b204f
|
@ -26,7 +26,7 @@ Type
|
|||
Function ConnectPipe (Secs: LongInt) : Boolean;
|
||||
// General functions
|
||||
Procedure SendToPipe (Var Buf; Len: Longint);
|
||||
Procedure ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongWord);
|
||||
Procedure ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongInt);
|
||||
Procedure Disconnect;
|
||||
Function DataWaiting : Boolean;
|
||||
End;
|
||||
|
@ -72,7 +72,7 @@ Begin
|
|||
If Not FileExist(PipeName) Then
|
||||
fpMkFIFO(PipeName, 438);
|
||||
|
||||
PipeHandle := fpOpen(PipeName, O_WRONLY, O_NONBLOCK);
|
||||
PipeHandle := fpOpen(PipeName, O_RDWR, O_NONBLOCK);
|
||||
Result := PipeHandle >= 0;
|
||||
End;
|
||||
|
||||
|
@ -84,7 +84,7 @@ Begin
|
|||
Disconnect;
|
||||
End;
|
||||
|
||||
Procedure TPipeUnix.ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongWord);
|
||||
Procedure TPipeUnix.ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongInt);
|
||||
Begin
|
||||
bRead := 0;
|
||||
|
||||
|
@ -114,7 +114,7 @@ Begin
|
|||
TimeOut := TimerSet(Secs);
|
||||
|
||||
Repeat
|
||||
PipeHandle := fpOpen(PipeName, O_RDONLY, O_NONBLOCK);
|
||||
PipeHandle := fpOpen(PipeName, O_RDWR, O_NONBLOCK);
|
||||
Connected := PipeHandle >= 0;
|
||||
Until Connected or TimerUp(TimeOut);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ Type
|
|||
PipeID : Word;
|
||||
Connected : Boolean;
|
||||
IsClient : Boolean;
|
||||
PipeHandle : THandle;
|
||||
PipeHandle : LongInt;
|
||||
|
||||
Constructor Create (Dir: String; Client: Boolean; ID: Word);
|
||||
Destructor Destroy; Override;
|
||||
|
@ -29,7 +29,7 @@ Type
|
|||
Function ConnectPipe (Secs: LongInt) : Boolean;
|
||||
// General functions
|
||||
Procedure SendToPipe (Var Buf; Len: Longint);
|
||||
Procedure ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongWord);
|
||||
Procedure ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongInt);
|
||||
Procedure Disconnect;
|
||||
Function DataWaiting : Boolean;
|
||||
End;
|
||||
|
@ -109,13 +109,13 @@ Begin
|
|||
Disconnect; // was ERROR_SUCCESS check
|
||||
End;
|
||||
|
||||
Procedure TPipeWindows.ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongWord);
|
||||
Procedure TPipeWindows.ReadFromPipe (Var Buf; Len: LongInt; Var bRead: LongInt);
|
||||
Begin
|
||||
bRead := 0;
|
||||
|
||||
If Not Connected Then Exit;
|
||||
|
||||
ReadFile (PipeHandle, Buf, Len, bRead, NIL);
|
||||
ReadFile (PipeHandle, Buf, Len, LongWord(bRead), NIL);
|
||||
|
||||
If GetLastError <> ERROR_SUCCESS Then
|
||||
Disconnect;
|
||||
|
|
Loading…
Reference in New Issue