From a9577b93a24f58c5b8986c90e9eff2353f608d02 Mon Sep 17 00:00:00 2001 From: Marcus Haehnel Date: Wed, 4 Jun 2025 10:15:49 +0200 Subject: inet/netdb: fix getnameinfo signature According to POSIX the getnameinfo flags parameter is int and not unsigned. Adapt accordingly. Glibc has also fixed this in commit e4ecafe004b3d4270b3a9dace8f970047400ed38 in 2001. Signed-off-by: Marcus Haehnel --- include/netdb.h | 2 +- libc/inet/resolv.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/netdb.h b/include/netdb.h index a85797956..26c999e59 100644 --- a/include/netdb.h +++ b/include/netdb.h @@ -689,7 +689,7 @@ extern const char *gai_strerror (int __ecode) __THROW; extern int getnameinfo (const struct sockaddr *__restrict __sa, socklen_t __salen, char *__restrict __host, socklen_t __hostlen, char *__restrict __serv, - socklen_t __servlen, unsigned int __flags); + socklen_t __servlen, int __flags); libc_hidden_proto(getnameinfo) #endif /* POSIX */ diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 130a9a505..44685e6b8 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -1892,7 +1892,7 @@ int getnameinfo(const struct sockaddr *sa, socklen_t hostlen, char *serv, socklen_t servlen, - unsigned flags) + int flags) { int serrno = errno; bool ok = 0; -- cgit v1.2.3