2
0
Эх сурвалжийг харах

* Correctly initialize address in acceptsocket

Michaël Van Canneyt 1 сар өмнө
parent
commit
ae08a3feba

+ 4 - 3
packages/fcl-net/src/ssockets.pp

@@ -11,6 +11,7 @@
 
 
  **********************************************************************}
  **********************************************************************}
 {$MODE objfpc}{$H+}
 {$MODE objfpc}{$H+}
+{$COPERATORS ON}
 {$R-}
 {$R-}
 
 
 {$IFNDEF FPC_DOTTEDUNITS}
 {$IFNDEF FPC_DOTTEDUNITS}
@@ -1455,12 +1456,12 @@ Var
 begin
 begin
   // Is basically the same except that the handle will be overwritten
   // Is basically the same except that the handle will be overwritten
   Result:=FSocket;
   Result:=FSocket;
-{$IFDEF UNIX}
-  R:=ESysEINTR;
-  // need to set this so ptr/addrsize are correct.
   naddr.SocketType:=Result.SocketType;
   naddr.SocketType:=Result.SocketType;
   naddr.GetAddrAndSize(AddrPtr,addrSize);
   naddr.GetAddrAndSize(AddrPtr,addrSize);
   Result.FD:=-1;
   Result.FD:=-1;
+{$IFDEF UNIX}
+  R:=ESysEINTR;
+  // need to set this so ptr/addrsize are correct.
   While SocketInvalid(Result.FD) and (R=ESysEINTR) do
   While SocketInvalid(Result.FD) and (R=ESysEINTR) do
 {$ENDIF UNIX}
 {$ENDIF UNIX}
    begin
    begin