Andrew Geissler | 87f5cff | 2022-09-30 13:13:31 -0500 | [diff] [blame^] | 1 | From 864f43ae09d18b1114d5c894e836698743e4e44c Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 6 Sep 2022 21:36:35 -0700 |
| 4 | Subject: [PATCH] sntp: Fix types in check for pthread_detach |
| 5 | |
| 6 | New compilers are stricter and flag assigning NULL to pthread_t as error |
| 7 | therefore using a pthread_t variable constructed from -1 |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | Signed-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 | |
| 15 | diff --git a/sntp/m4/openldap-thread-check.m4 b/sntp/m4/openldap-thread-check.m4 |
| 16 | index 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 | -- |
| 32 | 2.37.3 |
| 33 | |