Commit Graph

8 Commits

Author SHA1 Message Date
H.J. Lu
07e3eb1774 Use empty initializer to silence GCC 4.9 or older
Use empty initializer to silence GCC 4.9 or older:

getaddrinfo.c: In function ‘gaih_inet’:
getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces]
       / sizeof (struct gaih_typeproto)] = {0};
                        ^

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-16 04:06:30 +08:00
H.J. Lu
20f8c5df56 Revert "Add braces in initializers for GCC 4.9 or older"
This reverts commit 8aa2a9e033.

as not all targets need braces.
2024-12-15 18:49:52 +08:00
H.J. Lu
8aa2a9e033 Add braces in initializers for GCC 4.9 or older
Add braces to silence GCC 4.9 or older:

getaddrinfo.c: In function ‘gaih_inet’:
getaddrinfo.c:1135:24: error: missing braces around initializer [-Werror=missing-braces]
       / sizeof (struct gaih_typeproto)] = {0};
                        ^

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14 19:26:45 +08:00
Alejandro Colomar
53fcdf5f74 Silence most -Wzero-as-null-pointer-constant diagnostics
Replace 0 by NULL and {0} by {}.

Omit a few cases that aren't so trivial to fix.

Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059>
Link: <https://software.codidact.com/posts/292718/292759#answer-292759>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2024-11-25 16:45:59 -03:00
Andreas Schwab
5eabdb6a6a getaddrinfo: translate ENOMEM to EAI_MEMORY (bug 31163)
When __resolv_context_get returns NULL due to out of memory, translate it
to a return value of EAI_MEMORY.
2024-01-02 11:10:42 +01:00
Paul Eggert
dff8da6b3e Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
Florian Weimer
61bac1a9d2 nss: Remove unused allocation from get_nscd_addresses in getaddrinfo
No bug because this is not visible if glibc is built with
optimization.  Otherwise this would be a critical resource leak.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2023-12-20 16:14:33 +01:00
Arjun Shankar
7f602256ab Move getaddrinfo from 'posix' into 'nss'
getaddrinfo is an entry point for nss functionality.  This commit moves
it from 'sysdeps/posix' to 'nss', gets rid of the stub in 'posix', and
moves all associated tests as well.
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2023-10-24 12:31:00 +02:00