summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-26 07:20:30 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-26 07:20:30 -0400
commitfcf435a2c28f855f91bc08a6dcab72d0b12bfb67 (patch)
tree57a30abfdfccbbde3078bbe7b6d2930c84846c1e
parent88a4b6c95ddf299d00a32a924f42421e272558c4 (diff)
downloadgpsd-fcf435a2c28f855f91bc08a6dcab72d0b12bfb67.tar.gz
Proper integral-type conversion when stashing previous-fix time.
-rw-r--r--ppsthread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ppsthread.c b/ppsthread.c
index 49883cb3..9bbcdcf6 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -40,6 +40,7 @@
#include <string.h>
#include <errno.h>
#include <pthread.h>
+#include <math.h>
#ifndef S_SPLINT_S
#include <sys/socket.h>
#include <unistd.h>
@@ -583,7 +584,7 @@ static /*@null@*/ void *gpsd_ppsmonitor(void *arg)
*/
/*@+relaxtypes@*/
- drift.real.tv_sec = last_fixtime_real + 1;
+ drift.real.tv_sec = (time_t)trunc(last_fixtime_real) + 1;
drift.real.tv_nsec = 0; /* need to be fixed for 5Hz */
drift.clock = clock_ts;
/*@-relaxtypes@*/