summaryrefslogtreecommitdiff
path: root/gcc/ada/g-stsifd-sockets.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/g-stsifd-sockets.adb')
-rw-r--r--gcc/ada/g-stsifd-sockets.adb11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/ada/g-stsifd-sockets.adb b/gcc/ada/g-stsifd-sockets.adb
index 5fcaa00b37c..44bf2d8056e 100644
--- a/gcc/ada/g-stsifd-sockets.adb
+++ b/gcc/ada/g-stsifd-sockets.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, AdaCore --
+-- Copyright (C) 2001-2008, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -90,15 +90,14 @@ package body Signalling_Fds is
-- Bind the socket to an available port on localhost
- Len := Sin'Size / 8;
- Set_Length (Sin'Unchecked_Access, Len);
- Sin.Sin_Family := Constants.AF_INET;
+ Set_Family (Sin.Sin_Family, Family_Inet);
Sin.Sin_Addr.S_B1 := 127;
Sin.Sin_Addr.S_B2 := 0;
Sin.Sin_Addr.S_B3 := 0;
Sin.Sin_Addr.S_B4 := 1;
Sin.Sin_Port := 0;
+ Len := C.int (Lengths (Family_Inet));
Res := C_Bind (L_Sock, Sin'Address, Len);
if Res = Failure then
@@ -143,7 +142,7 @@ package body Signalling_Fds is
-- marked "in use", even though it has been closed (perhaps by some
-- other process that has already exited). This causes the above
-- C_Connect to fail with EADDRINUSE. In this case, we close the
- -- ports, and loop back to try again. This mysterious windows
+ -- ports, and loop back to try again. This mysterious Windows
-- behavior is documented. See, for example:
-- http://msdn2.microsoft.com/en-us/library/ms737625.aspx
-- In an experiment with 2000 calls, 21 required exactly one retry, 7
@@ -186,7 +185,7 @@ package body Signalling_Fds is
Fds.all := (Read_End => R_Sock, Write_End => W_Sock);
- return Success;
+ return Thin_Common.Success;
<<Fail>>
declare