OSDN Git Service

* decl2.c (maybe_emit_vtables): Produce same comdat group when outputting
[pf3gnuchains/gcc-fork.git] / gcc / ada / g-stsifd-sockets.adb
index bb6095c..3e3f451 100644 (file)
@@ -67,7 +67,8 @@ package body Signalling_Fds is
       --  Address of listening socket
 
       Res : C.int;
-      --  Return status of system calls
+      pragma Warnings (Off, Res);
+      --  Return status of system calls (usually ignored, hence warnings off)
 
    begin
       Fds.all := (Read_End | Write_End => Failure);
@@ -82,7 +83,7 @@ package body Signalling_Fds is
 
          --  Create a listening socket
 
-         L_Sock := C_Socket (SOSC.AF_INET, Constants.SOCK_STREAM, 0);
+         L_Sock := C_Socket (SOSC.AF_INET, SOSC.SOCK_STREAM, 0);
 
          if L_Sock = Failure then
             goto Fail;
@@ -122,7 +123,7 @@ package body Signalling_Fds is
 
          --  Create read end (client) socket
 
-         R_Sock := C_Socket (SOSC.AF_INET, Constants.SOCK_STREAM, 0);
+         R_Sock := C_Socket (SOSC.AF_INET, SOSC.SOCK_STREAM, 0);
 
          if R_Sock = Failure then
             goto Fail;
@@ -153,9 +154,7 @@ package body Signalling_Fds is
          pragma Assert (Res = Failure
                           and then
                         Socket_Errno = SOSC.EADDRINUSE);
-         pragma Warnings (Off); -- useless assignment to "Res"
          Res := C_Close (W_Sock);
-         pragma Warnings (On);
          W_Sock := Failure;
          Res := C_Close (R_Sock);
          R_Sock := Failure;
@@ -227,7 +226,11 @@ package body Signalling_Fds is
    function Write (Wsig : C.int) return C.int is
       Buf : aliased Character := ASCII.NUL;
    begin
-      return C_Send (Wsig, Buf'Address, 1, SOSC.MSG_Forced_Flags);
+      return C_Sendto
+        (Wsig, Buf'Address, 1,
+         Flags => SOSC.MSG_Forced_Flags,
+         To    => System.Null_Address,
+         Tolen => 0);
    end Write;
 
 end Signalling_Fds;