]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sched: initialize sub-second part of saved_tv in SCH_MainLoop()
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 7 Sep 2016 09:49:36 +0000 (11:49 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 12 Sep 2016 10:49:18 +0000 (12:49 +0200)
This is needed since commit d0dfa1de9e85510a584cdec5faae96c66d6847c9 to
avoid valgrind errors.

sched.c

diff --git a/sched.c b/sched.c
index d6a1ebac05422de7614de406a9c455c857ef153b..2cbc29bb8cf0c982580b30740467af1630b152da 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -707,8 +707,7 @@ SCH_MainLoop(void)
       saved_tv = tv;
     } else {
       ptv = NULL;
-      /* This is needed to fix a compiler warning */
-      saved_tv.tv_sec = 0;
+      saved_tv.tv_sec = saved_tv.tv_usec = 0;
     }
 
     p_read_fds = &read_fds;