]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
util: fix compiler warning with 32-bit time_t
authorMiroslav Lichvar <mlichvar@redhat.com>
Thu, 21 Aug 2014 12:06:06 +0000 (14:06 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 21 Aug 2014 12:06:46 +0000 (14:06 +0200)
util.c

diff --git a/util.c b/util.c
index 5fecd258daef15e81ec78c781b99c6186ab9f9c7..08fc0cdc395e5547e1733c4af8503b2089a352ea 100644 (file)
--- a/util.c
+++ b/util.c
@@ -550,13 +550,15 @@ UTI_Int64ToTimeval(NTP_int64 *src,
 void
 UTI_TimevalNetworkToHost(Timeval *src, struct timeval *dest)
 {
-  uint32_t sec_low, sec_high;
+  uint32_t sec_low;
+#ifdef HAVE_LONG_TIME_T
+  uint32_t sec_high;
+#endif
 
   dest->tv_usec = ntohl(src->tv_nsec) / 1000;
-  sec_high = ntohl(src->tv_sec_high);
   sec_low = ntohl(src->tv_sec_low);
-
 #ifdef HAVE_LONG_TIME_T
+  sec_high = ntohl(src->tv_sec_high);
   if (sec_high == TV_NOHIGHSEC)
     sec_high = 0;