diff mbox series

[meta-networking,10/22] ntp: Fix check for pthread_detach

Message ID 20220907234102.3312797-10-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,01/22] openldap: Fix configure check for pthread_detach | expand

Commit Message

Khem Raj Sept. 7, 2022, 11:40 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...ix-types-in-check-for-pthread_detach.patch | 33 +++++++++++++++++++
 .../recipes-support/ntp/ntp_4.2.8p15.bb       |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 meta-networking/recipes-support/ntp/ntp/0001-sntp-Fix-types-in-check-for-pthread_detach.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/ntp/ntp/0001-sntp-Fix-types-in-check-for-pthread_detach.patch b/meta-networking/recipes-support/ntp/ntp/0001-sntp-Fix-types-in-check-for-pthread_detach.patch
new file mode 100644
index 0000000000..ca15470ace
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp/0001-sntp-Fix-types-in-check-for-pthread_detach.patch
@@ -0,0 +1,33 @@ 
+From 864f43ae09d18b1114d5c894e836698743e4e44c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 6 Sep 2022 21:36:35 -0700
+Subject: [PATCH] sntp: Fix types in check for pthread_detach
+
+New compilers are stricter and flag assigning NULL to pthread_t as error
+therefore using a pthread_t variable constructed from -1
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sntp/m4/openldap-thread-check.m4 | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/sntp/m4/openldap-thread-check.m4 b/sntp/m4/openldap-thread-check.m4
+index 7768a5c..b9e54ad 100644
+--- a/sntp/m4/openldap-thread-check.m4
++++ b/sntp/m4/openldap-thread-check.m4
+@@ -262,10 +262,7 @@ pthread_rwlock_t rwlock;
+ 				dnl save the flags
+ 				AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #include <pthread.h>
+-#ifndef NULL
+-#define NULL (void*)0
+-#endif
+-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
++]], [[pthread_detach((pthread_t)-1);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
+ 			])
+ 
+ 			if test $ol_cv_func_pthread_detach = no ; then
+-- 
+2.37.3
+
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.8p15.bb b/meta-networking/recipes-support/ntp/ntp_4.2.8p15.bb
index a30f720bb5..50f5477f27 100644
--- a/meta-networking/recipes-support/ntp/ntp_4.2.8p15.bb
+++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p15.bb
@@ -15,6 +15,7 @@  SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g
            file://reproducibility-fixed-path-to-posix-shell.patch \
            file://0001-libntp-Do-not-use-PTHREAD_STACK_MIN-on-glibc.patch \
            file://0001-test-Fix-build-with-new-compiler-defaults-to-fno-com.patch \
+           file://0001-sntp-Fix-types-in-check-for-pthread_detach.patch \
            file://ntpd \
            file://ntp.conf \
            file://ntpdate \