blob: ca15470aceb30b23120a46634a7a09f0e8955fec [file] [log] [blame]
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001From 864f43ae09d18b1114d5c894e836698743e4e44c Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 6 Sep 2022 21:36:35 -0700
4Subject: [PATCH] sntp: Fix types in check for pthread_detach
5
6New compilers are stricter and flag assigning NULL to pthread_t as error
7therefore using a pthread_t variable constructed from -1
8
9Upstream-Status: Pending
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 sntp/m4/openldap-thread-check.m4 | 5 +----
13 1 file changed, 1 insertion(+), 4 deletions(-)
14
15diff --git a/sntp/m4/openldap-thread-check.m4 b/sntp/m4/openldap-thread-check.m4
16index 7768a5c..b9e54ad 100644
17--- a/sntp/m4/openldap-thread-check.m4
18+++ b/sntp/m4/openldap-thread-check.m4
19@@ -262,10 +262,7 @@ pthread_rwlock_t rwlock;
20 dnl save the flags
21 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
22 #include <pthread.h>
23-#ifndef NULL
24-#define NULL (void*)0
25-#endif
26-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
27+]], [[pthread_detach((pthread_t)-1);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
28 ])
29
30 if test $ol_cv_func_pthread_detach = no ; then
31--
322.37.3
33