ntp: Fix check for pthread_detach

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Khem Raj 2022-09-06 21:38:43 -07:00
parent 5b73deaf18
commit 4b80488e3b
2 changed files with 34 additions and 0 deletions

View File

@ -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

View File

@ -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 \