From b1f05b204f1c1192b3155f0a2292e40846767793 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Mon, 24 Sep 2012 13:47:50 -0400 Subject: [PATCH] Some code was unreachable due to a LongWord declaration --- mdl/m_pipe_unix.pas | 8 ++++---- mdl/m_pipe_windows.pas | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mdl/m_pipe_unix.pas b/mdl/m_pipe_unix.pas index c885cc0..f75b5b4 100644 --- a/mdl/m_pipe_unix.pas +++ b/mdl/m_pipe_unix.pas @@ -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); diff --git a/mdl/m_pipe_windows.pas b/mdl/m_pipe_windows.pas index 1190c12..7f4fb47 100644 --- a/mdl/m_pipe_windows.pas +++ b/mdl/m_pipe_windows.pas @@ -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;