1 From ae1e5217021e43e1f2de443d26e87ea3adfb221c Mon Sep 17 00:00:00 2001
2 From: Andreas Schwab <schwab@suse.de>
3 Date: Wed, 6 Dec 2023 14:48:22 +0100
4 Subject: [PATCH 40/44] getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163)
6 When __resolv_context_get returns NULL due to out of memory, translate it
7 to a return value of EAI_MEMORY.
9 (cherry picked from commit 5eabdb6a6ac1599d23dd5966a37417215950245f)
11 sysdeps/posix/getaddrinfo.c | 9 ++++++++-
12 1 file changed, 8 insertions(+), 1 deletion(-)
14 diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
15 index 13082305d3..da573bea24 100644
16 --- a/sysdeps/posix/getaddrinfo.c
17 +++ b/sysdeps/posix/getaddrinfo.c
18 @@ -616,7 +616,14 @@ get_nss_addresses (const char *name, const struct addrinfo *req,
20 res_ctx = __resolv_context_get ();
24 + if (errno == ENOMEM)
26 + result = -EAI_MEMORY;