summaryrefslogtreecommitdiff
path: root/gcc/ada/g-socthi.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-07 15:01:27 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-07 15:01:27 +0000
commit38d2fa31f60fb5aaf3dea1214bbf9001ab94f600 (patch)
tree97de4be619b593f2d66a2fa45de2b0a01f1177c0 /gcc/ada/g-socthi.adb
parent4076879ffa527f474935dec2d6c49acdaa9d5353 (diff)
downloadgcc-38d2fa31f60fb5aaf3dea1214bbf9001ab94f600.tar.gz
2009-04-07 Robert Dewar <dewar@adacore.com>
(Osint.Fail): Change calling sequence to have one string arg (Make.Make_Failed): Same change All callers are adjusted to use concatenation 2009-04-07 Robert Dewar <dewar@adacore.com> * exp_ch4.adb: Fix documentation typo 2009-04-07 Robert Dewar <dewar@adacore.com> * tbuild.ads: Minor reformatting 2009-04-07 Javier Miranda <miranda@adacore.com> * exp_disp.adb (Make_DT): Avoid the generation of the OSD_Table when compiling under ZFP runtime. 2009-04-07 Robert Dewar <dewar@adacore.com> * g-comlin.adb: Minor reformatting 2009-04-07 Thomas Quinot <quinot@adacore.com> * socket.c, g-socthi-vms.adb, g-socthi-vms.ads, g-socthi-vxworks.adb, g-socthi-vxworks.ads, g-socthi-mingw.adb, g-socthi-mingw.ads, g-socthi.adb, g-socthi.ads, g-socket.adb, g-socket.ads, g-sothco.ads: Remove dynamic allocation of Fd_Set in Socket_Set_Type objects. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145678 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-socthi.adb')
-rw-r--r--gcc/ada/g-socthi.adb21
1 files changed, 9 insertions, 12 deletions
diff --git a/gcc/ada/g-socthi.adb b/gcc/ada/g-socthi.adb
index 57b76bc2fe0..289adbe7932 100644
--- a/gcc/ada/g-socthi.adb
+++ b/gcc/ada/g-socthi.adb
@@ -44,8 +44,7 @@ with Interfaces.C; use Interfaces.C;
package body GNAT.Sockets.Thin is
- Non_Blocking_Sockets : constant Fd_Set_Access :=
- New_Socket_Set (No_Fd_Set_Access);
+ Non_Blocking_Sockets : aliased Fd_Set;
-- When this package is initialized with Process_Blocking_IO set
-- to True, sockets are set in non-blocking mode to avoid blocking
-- the whole process when a thread wants to perform a blocking IO
@@ -195,32 +194,29 @@ package body GNAT.Sockets.Thin is
end if;
declare
- WSet : Fd_Set_Access;
+ WSet : aliased Fd_Set;
Now : aliased Timeval;
begin
- WSet := New_Socket_Set (No_Fd_Set_Access);
+ Reset_Socket_Set (WSet'Access);
loop
- Insert_Socket_In_Set (WSet, S);
+ Insert_Socket_In_Set (WSet'Access, S);
Now := Immediat;
Res := C_Select
(S + 1,
No_Fd_Set_Access,
- WSet,
+ WSet'Access,
No_Fd_Set_Access,
Now'Unchecked_Access);
exit when Res > 0;
if Res = Failure then
- Free_Socket_Set (WSet);
return Res;
end if;
delay Quantum;
end loop;
-
- Free_Socket_Set (WSet);
end;
Res := Syscall_Connect (S, Name, Namelen);
@@ -412,6 +408,7 @@ package body GNAT.Sockets.Thin is
procedure Initialize is
begin
Disable_All_SIGPIPEs;
+ Reset_Socket_Set (Non_Blocking_Sockets'Access);
end Initialize;
-------------------------
@@ -422,7 +419,7 @@ package body GNAT.Sockets.Thin is
R : Boolean;
begin
Task_Lock.Lock;
- R := (Is_Socket_In_Set (Non_Blocking_Sockets, S) /= 0);
+ R := (Is_Socket_In_Set (Non_Blocking_Sockets'Access, S) /= 0);
Task_Lock.Unlock;
return R;
end Non_Blocking_Socket;
@@ -436,9 +433,9 @@ package body GNAT.Sockets.Thin is
Task_Lock.Lock;
if V then
- Insert_Socket_In_Set (Non_Blocking_Sockets, S);
+ Insert_Socket_In_Set (Non_Blocking_Sockets'Access, S);
else
- Remove_Socket_From_Set (Non_Blocking_Sockets, S);
+ Remove_Socket_From_Set (Non_Blocking_Sockets'Access, S);
end if;
Task_Lock.Unlock;