From 0b01fd9b6722d13afa35c8ce07ff65bbe9c0f33b Mon Sep 17 00:00:00 2001 From: nia Date: Thu, 11 Jun 2020 12:29:15 +0100 Subject: [PATCH 1/3] net_sockets: Fix building on NetBSD 9.0 Fixes #2310 Signed-off-by: nia --- library/net_sockets.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/net_sockets.c b/library/net_sockets.c index 8258aea73e..b26e858185 100644 --- a/library/net_sockets.c +++ b/library/net_sockets.c @@ -23,6 +23,7 @@ * be set before config.h, which pulls in glibc's features.h indirectly. * Harmless on other platforms. */ #define _POSIX_C_SOURCE 200112L +#define _XOPEN_SOURCE 600 /* sockaddr_storage */ #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" @@ -322,7 +323,8 @@ int mbedtls_net_accept( mbedtls_net_context *bind_ctx, struct sockaddr_storage client_addr; #if defined(__socklen_t_defined) || defined(_SOCKLEN_T) || \ - defined(_SOCKLEN_T_DECLARED) || defined(__DEFINED_socklen_t) + defined(_SOCKLEN_T_DECLARED) || defined(__DEFINED_socklen_t) || \ + defined(socklen_t) socklen_t n = (socklen_t) sizeof( client_addr ); socklen_t type_len = (socklen_t) sizeof( type ); #else From 7eb0e62f6414897ac9b3b7561de729405d803f60 Mon Sep 17 00:00:00 2001 From: nia Date: Thu, 11 Jun 2020 12:30:12 +0100 Subject: [PATCH 2/3] ssl_mail_client: Define _XOPEN_SOURCE=600 for gethostname Fixes building this program on NetBSD 9.0. Signed-off-by: nia --- programs/ssl/ssl_mail_client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/ssl/ssl_mail_client.c b/programs/ssl/ssl_mail_client.c index 08ff025956..b7458cd212 100644 --- a/programs/ssl/ssl_mail_client.c +++ b/programs/ssl/ssl_mail_client.c @@ -23,6 +23,7 @@ * be set before config.h, which pulls in glibc's features.h indirectly. * Harmless on other platforms. */ #define _POSIX_C_SOURCE 200112L +#define _XOPEN_SOURCE 600 #if !defined(MBEDTLS_CONFIG_FILE) #include "mbedtls/config.h" From 508e21ccfdd7107303bce9bcbbc093a0d2c65006 Mon Sep 17 00:00:00 2001 From: nia Date: Thu, 11 Jun 2020 13:55:07 +0100 Subject: [PATCH 3/3] Add ChangeLog.d entry for #3422 Signed-off-by: nia --- ChangeLog.d/bugfix_PR3422.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 ChangeLog.d/bugfix_PR3422.txt diff --git a/ChangeLog.d/bugfix_PR3422.txt b/ChangeLog.d/bugfix_PR3422.txt new file mode 100644 index 0000000000..dfe152c369 --- /dev/null +++ b/ChangeLog.d/bugfix_PR3422.txt @@ -0,0 +1,2 @@ +Bugfix + * Fix building library/net_sockets.c and the ssl_mail_client program on NetBSD. Contributed by Nia Alarie in #3422.