diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-20 14:37:41 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-11-20 14:37:41 +0000 |
commit | 2be1f7d783dd104e2e4ceccac5fa48aea81e9371 (patch) | |
tree | e1940f1eb67889bd6cf3127794232c03cc222533 /gcc/ada/g-socket.adb | |
parent | 1241e3318edefec8fd89119ee5497d0374b5ac90 (diff) | |
download | gcc-2be1f7d783dd104e2e4ceccac5fa48aea81e9371.tar.gz |
2014-11-20 Thomas Quinot <quinot@adacore.com>
* g-socket.adb (To_Host_Entry): Guard against case of a
non-AF_INET entry.
2014-11-20 Vadim Godunko <godunko@adacore.com>
* a-strunb-shared.adb (To_Unbounded_String): Use shared empty
object to construct return value when source string is empty or
requested length is zero.
* a-stwiun-shared.adb (To_Unbounded_Wide_String): Likewise.
* a-stzunb-shared.adb (To_Unbounded_Wide_Wide_String): Likewise.
2014-11-20 Yannick Moy <moy@adacore.com>
* a-cfhase.adb, a-cfinve.adb, a-cforma.adb, a-cfhama.adb, a-cforse.adb,
a-cofove.adb: Skip CodePeer analysis on body of all formal containers.
2014-11-20 Arnaud Charlet <charlet@adacore.com>
* adaint.c: Fix typo.
* exp_util.adb (Make_Subtype_From_Expr): Complete previous change,
generate constant values.
* sem_eval.adb (Decompose_Expr): Fix latent bug leading to a wrong
evaluation to '0' of some unknown values.
2014-11-20 Robert Dewar <dewar@adacore.com>
* repinfo.adb (List_Record_Info): Do not list discriminant in
unchecked union.
* sem_ch13.adb (Has_Good_Profile): Minor reformatting
(Analyze_Stream_TSS_Definition): Minor reformatting
(Analyze_Record_Representation_Clause): Do not issue warning
for missing rep clause for discriminant in unchecked union.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217861 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/g-socket.adb')
-rw-r--r-- | gcc/ada/g-socket.adb | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index 94125173515..3a10c9cb929 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -976,11 +976,17 @@ package body GNAT.Sockets is Raise_Host_Error (Integer (Err)); end if; - return H : constant Host_Entry_Type := - To_Host_Entry (Res'Unchecked_Access) - do - Netdb_Unlock; - end return; + begin + return H : constant Host_Entry_Type := + To_Host_Entry (Res'Unchecked_Access) + do + Netdb_Unlock; + end return; + exception + when others => + Netdb_Unlock; + raise; + end; end Get_Host_By_Address; ---------------------- @@ -2420,9 +2426,13 @@ package body GNAT.Sockets is Aliases_Count, Addresses_Count : Natural; -- H_Length is not used because it is currently only ever set to 4, as - -- H_Addrtype is always AF_INET. + -- we only handle the case of H_Addrtype being AF_INET. begin + if Hostent_H_Addrtype (E) /= SOSC.AF_INET then + Raise_Socket_Error (SOSC.EPFNOSUPPORT); + end if; + Aliases_Count := 0; while Hostent_H_Alias (E, C.int (Aliases_Count)) /= Null_Address loop Aliases_Count := Aliases_Count + 1; |