]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix pthread.h include (#4943)
authorJorge Pereira <jpereira@users.noreply.github.com>
Tue, 28 Mar 2023 17:01:34 +0000 (14:01 -0300)
committerGitHub <noreply@github.com>
Tue, 28 Mar 2023 17:01:34 +0000 (11:01 -0600)
It needs to avoid:

src/lib/event.c:127:2: error: call to undeclared function 'pthread_mutex_destroy'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
CC src/lib/getaddrinfo.c
        pthread_mutex_destroy(&el->mutex);
        ^
src/lib/event.c:162:9: error: call to undeclared function 'pthread_mutex_init'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        pthread_mutex_init(&el->mutex, NULL);
        ^
src/lib/event.c:478:2: error: call to undeclared function 'pthread_mutex_lock'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
        pthread_mutex_lock(&el->mutex);
        ^

src/lib/event.c

index 2db5d3401dd1abae50cf4e96c1b95d6afec3577d..7a97b83f732c7df785b2400e9273bb3a0872f805 100644 (file)
@@ -28,13 +28,14 @@ RCSID("$Id$")
 #include <freeradius-devel/heap.h>
 #include <freeradius-devel/event.h>
 
+#include <pthread.h>
+
 #ifdef HAVE_KQUEUE
 #ifndef HAVE_SYS_EVENT_H
 #error kqueue requires <sys/event.h>
 
 #else
 #include <sys/event.h>
-#include <pthread.h>
 #endif
 #endif /* HAVE_KQUEUE */