소스 검색

* fix missing socketerror discrepancy

git-svn-id: trunk@7314 -
Almindor 18 년 전
부모
커밋
2086107cf3
3개의 변경된 파일6개의 추가작업 그리고 7개의 파일을 삭제
  1. 3 3
      rtl/inc/sockets.inc
  2. 2 2
      rtl/inc/socketsh.inc
  3. 1 2
      rtl/inc/sockovl.inc

+ 3 - 3
rtl/inc/sockets.inc

@@ -48,7 +48,7 @@ begin
 {$else}
               r:=send(handle,bufptr^,bufpos,0);
 {$endif}
-            until (r<>-1) or (socketerror<>EsockEINTR);
+            until (r<>-1) or (fpGetErrno <> EsockEINTR);
             bufend:=r;
             def_error:=101; {File write error.}
           end;
@@ -60,13 +60,13 @@ begin
 {$else}
               r:=recv(handle,bufptr^,bufsize,0);
 {$endif}
-            until (r<>-1) or (socketerror<>EsockEINTR);
+            until (r<>-1) or (fpGetErrno <> EsockEINTR);
             bufend:=r;
             def_error:=100; {File read error.}
           end;
       end;
       if r=-1 then
-        case socketerror of
+        case fpGetErrno of
           EsockEBADF:
 {          EsysENOTSOCK:}   {Why is this constant not defined? (DM)}
             inoutres:=6;    {Invalid file handle.}

+ 2 - 2
rtl/inc/socketsh.inc

@@ -160,7 +160,7 @@ type
   Tsocket=longint;   {To easy porting code from Kylix libc unit to sockets unit.}
 
 
-{$ifdef Unix}
+(*{$ifdef Unix}
    {$define socketerror_defined}
    property socketerror : cint read fpgeterrno;
 {$endif}
@@ -173,7 +173,7 @@ type
 {$ifndef socketerror_defined}
 Var
   SocketError:cint;
-{$endif}
+{$endif}*)
 
 function  fpsocket      (domain:cint; xtype:cint; protocol: cint):cint;
 function  fprecv        (s:cint; buf: pointer; len: size_t; flags: cint):ssize_t;

+ 1 - 2
rtl/inc/sockovl.inc

@@ -115,8 +115,7 @@ var
   AddrLen  : longint;
 begin
   Str2UnixSockAddr(addr,UnixAddr,AddrLen);
-  Bind(Sock,UnixAddr,AddrLen);
-  Bind:=(SocketError=0);
+  Bind := Bind(Sock, UnixAddr, AddrLen); // what the flying fuck were you thinking?
 end;