浏览代码

* make it work on non-unix too...

git-svn-id: trunk@7315 -
Almindor 18 年之前
父节点
当前提交
fa232dd4ac
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 3 3
      rtl/inc/sockets.inc
  2. 2 2
      rtl/inc/socketsh.inc

+ 3 - 3
rtl/inc/sockets.inc

@@ -48,7 +48,7 @@ begin
 {$else}
               r:=send(handle,bufptr^,bufpos,0);
 {$endif}
-            until (r<>-1) or (fpGetErrno <> EsockEINTR);
+            until (r<>-1) or (SocketError <> 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 (fpGetErrno <> EsockEINTR);
+            until (r<>-1) or (SocketError <> EsockEINTR);
             bufend:=r;
             def_error:=100; {File read error.}
           end;
       end;
       if r=-1 then
-        case fpGetErrno of
+        case SocketError 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;