summaryrefslogtreecommitdiff
path: root/gcc/ada/g-socthi.adb
diff options
context:
space:
mode:
authorThomas Quinot <quinot@adacore.com>2009-04-17 13:39:10 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-04-17 15:39:10 +0200
commitaed6fda81baff76d645be701b8bff8c458498745 (patch)
tree0f576309d61e6257ec752f221eca1047adf3bc41 /gcc/ada/g-socthi.adb
parentc5d91669f305eb83adb2ef982b05ee19a15fbf47 (diff)
downloadgcc-aed6fda81baff76d645be701b8bff8c458498745.tar.gz
re PR ada/35953 (Socket stream subprograms incorrectly handling null arrays)
2009-04-17 Thomas Quinot <quinot@adacore.com> PR ada/35953 * 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-stsifd-sockets.adb, g-socthi.ads, g-socket.adb, g-socket.ads (GNAT.Sockets.Thin.C_Send, GNAT.Sockets.Thin.Syscall_Send): Remove unused subprograms. Replace calls to send(2) with equivalent sendto(2) calls. (GNAT.Sockets.Send_Socket): Factor common code in inlined subprogram. (GNAT.Sockets.Write): Account for the case of hyper-empty arrays, do not report an error in that case. Factor code common to the two versions (datagram and stream) in common routine Stream_Write. From-SVN: r146267
Diffstat (limited to 'gcc/ada/g-socthi.adb')
-rw-r--r--gcc/ada/g-socthi.adb32
1 files changed, 0 insertions, 32 deletions
diff --git a/gcc/ada/g-socthi.adb b/gcc/ada/g-socthi.adb
index 1062354f9b5..fab5fb3ac9e 100644
--- a/gcc/ada/g-socthi.adb
+++ b/gcc/ada/g-socthi.adb
@@ -98,13 +98,6 @@ package body GNAT.Sockets.Thin is
Fromlen : not null access C.int) return C.int;
pragma Import (C, Syscall_Recvfrom, "recvfrom");
- function Syscall_Send
- (S : C.int;
- Msg : System.Address;
- Len : C.int;
- Flags : C.int) return C.int;
- pragma Import (C, Syscall_Send, "send");
-
function Syscall_Sendto
(S : C.int;
Msg : System.Address;
@@ -303,31 +296,6 @@ package body GNAT.Sockets.Thin is
return Res;
end C_Recvfrom;
- ------------
- -- C_Send --
- ------------
-
- function C_Send
- (S : C.int;
- Msg : System.Address;
- Len : C.int;
- Flags : C.int) return C.int
- is
- Res : C.int;
-
- begin
- loop
- Res := Syscall_Send (S, Msg, Len, Flags);
- exit when SOSC.Thread_Blocking_IO
- or else Res /= Failure
- or else Non_Blocking_Socket (S)
- or else Errno /= SOSC.EWOULDBLOCK;
- delay Quantum;
- end loop;
-
- return Res;
- end C_Send;
-
--------------
-- C_Sendto --
--------------