diff --git a/rtl/inc/sockets.inc b/rtl/inc/sockets.inc index edb6acf27e..f7739b4f81 100644 --- a/rtl/inc/sockets.inc +++ b/rtl/inc/sockets.inc @@ -48,7 +48,7 @@ begin {$else} r:=send(handle,bufptr^,bufpos,0); {$endif} - until (r<>-1) or (errno<>EsysEINTR); + until (r<>-1) or (socketerror<>EsockEINTR); bufend:=r; def_error:=101; {File write error.} end; @@ -60,19 +60,19 @@ begin {$else} r:=recv(handle,bufptr^,bufsize,0); {$endif} - until (r<>-1) or (errno<>EsysEINTR); + until (r<>-1) or (socketerror<>EsockEINTR); bufend:=r; def_error:=100; {File read error.} end; end; if r=-1 then case errno of - EsysEBADF: + EsockEBADF: { EsysENOTSOCK:} {Why is this constant not defined? (DM)} inoutres:=6; {Invalid file handle.} - EsysEFAULT: + EsockEFAULT: inoutres:=217; - EsysEINVAL: + EsockEINVAL: inoutres:=218; else inoutres:=def_error; diff --git a/rtl/os2/sockets.pas b/rtl/os2/sockets.pas index 7692036eb3..ae386223c8 100644 --- a/rtl/os2/sockets.pas +++ b/rtl/os2/sockets.pas @@ -96,6 +96,11 @@ Const PF_MAX = so32dll.PF_MAX; +const EsockEINTR = SOCEINTR; + EsockEBADF = SOCEBADF; + EsockEFAULT = SOCEFAULT; + EsockEINVAL = SOCEINVAL; + Type cushort=word; diff --git a/rtl/unix/sockets.pp b/rtl/unix/sockets.pp index 1a36f2696e..14b9d43f52 100644 --- a/rtl/unix/sockets.pp +++ b/rtl/unix/sockets.pp @@ -14,7 +14,7 @@ unit Sockets; Interface {$ifdef Unix} -Uses UnixType; +Uses baseunix,UnixType; {$endif} {$ifdef FreeBSD} @@ -37,6 +37,10 @@ type path:array[0..107] of char; //104 total for freebsd. end; +const EsockEINTR = EsysEINTR; + EsockEBADF = EsysEBADF; + EsockEFAULT = EsysEFAULT; + EsockEINVAL = EsysEINVAL; { unix socket specific functions } Procedure Str2UnixSockAddr(const addr:string;var t:TUnixSockAddr;var len:longint); @@ -52,7 +56,7 @@ Function Accept(Sock:longint;var addr:string;var SockIn,SockOut:File):Boolean; Implementation -Uses BaseUnix,{$ifndef FPC_USE_LIBC}SysCall{$else}initc{$endif}; +Uses {$ifndef FPC_USE_LIBC}SysCall{$else}initc{$endif}; { Include filerec and textrec structures } {$i filerec.inc} diff --git a/rtl/win/sockets.pp b/rtl/win/sockets.pp index e89a07a3c8..4304e71d56 100644 --- a/rtl/win/sockets.pp +++ b/rtl/win/sockets.pp @@ -27,6 +27,10 @@ Type tsocklen= cint; psocklen= ^tsocklen; +const EsockEINTR = WSAEINTR; + EsockEBADF = WSAEBADF; + EsockEFAULT = WSAEFAULT; + EsockEINVAL = WSAEINVAL; {$i socketsh.inc} {$i fpwinsockh.inc}