Use existing time_t rounding function, don't invent my own.
authorJeremy Allison <jra@samba.org>
Mon, 24 Aug 2009 22:09:29 +0000 (15:09 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 24 Aug 2009 22:09:29 +0000 (15:09 -0700)
Jeremy.

source3/lib/time.c

index c80b59a662f77f39bdd9eeccf39fc4ba187df92a..a9f7899c7bda078756a4bc84ce7149f0cdbf5d9a 100644 (file)
@@ -474,7 +474,7 @@ int timespec_compare(const struct timespec *ts1, const struct timespec *ts2)
 
 void round_timespec(struct timespec *ts)
 {
-       ts->tv_sec += ts->tv_nsec >= 500000000 ? 1 : 0;
+       ts->tv_sec = convert_timespec_to_time_t(*ts);
        ts->tv_nsec = 0;
 }