configure: harden clockid_t test
authorJens Axboe <axboe@fb.com>
Fri, 16 Sep 2016 16:08:15 +0000 (10:08 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 16 Sep 2016 16:08:15 +0000 (10:08 -0600)
Don't assume we can assign '0' to a clockid_t type, let's just
memset it to be on the safe side.

Signed-off-by: Jens Axboe <axboe@fb.com>
configure

index 14ec47e9743399707c027db282d612a0daacbc9b..a24e3eff7fd4985ba66fe4a8a0aedcc6d3f14088 100755 (executable)
--- a/configure
+++ b/configure
@@ -798,10 +798,12 @@ echo "CLOCK_MONOTONIC_PRECISE       $clock_monotonic_precise"
 clockid_t="no"
 cat > $TMPC << EOF
 #include <stdio.h>
+#include <string.h>
 #include <time.h>
 int main(int argc, char **argv)
 {
-  clockid_t cid = 0;
+  clockid_t cid;
+  memset(&cid, 0, sizeof(cid));
   return clock_gettime(cid, NULL);
 }
 EOF