]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
configure: fix warnings in tests
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 18 Jun 2019 14:20:59 +0000 (16:20 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 18 Jun 2019 14:24:01 +0000 (16:24 +0200)
Fix some warnings in configure tests reported by clang and coverity
static analyzer.

configure

index 323f5743cd57009cf50a7eb3e24fa16d71df4f62..e09d758d253acb966ba6f6a76e3de756d7ec143a 100755 (executable)
--- a/configure
+++ b/configure
@@ -654,8 +654,9 @@ then
 fi
 
 if [ $feat_asyncdns = "1" ] && \
-  test_code 'pthread' 'pthread.h' '-pthread' '' \
-    'return (int)pthread_create((void *)1, NULL, (void *)1, NULL);'
+  test_code 'pthread' 'pthread.h' '-pthread' '' '
+    pthread_t thread;
+    return (int)pthread_create(&thread, NULL, (void *)1, NULL);'
 then
   add_def FEAT_ASYNCDNS
   add_def USE_PTHREAD_ASYNCDNS
@@ -731,6 +732,7 @@ if [ "x$timepps_h" != "x" ] && \
     pps_handle_t h = 0;
     pps_info_t i;
     struct timespec ts;
+    ts.tv_sec = ts.tv_nsec = 0;
     return time_pps_fetch(h, PPS_TSFMT_TSPEC, &i, &ts);'
 then
   add_def FEAT_PPS
@@ -817,6 +819,7 @@ if [ $try_lockmem = "1" ] && \
     'setrlimit(RLIMIT_MEMLOCK, ...)' \
     'sys/resource.h' '' '' '
      struct rlimit rlim;
+     rlim.rlim_max = rlim.rlim_cur = RLIM_INFINITY;
      setrlimit(RLIMIT_MEMLOCK, &rlim);'
 then
   add_def HAVE_SETRLIMIT_MEMLOCK