diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2014-08-26 07:20:30 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-08-26 07:20:30 -0400 |
commit | fcf435a2c28f855f91bc08a6dcab72d0b12bfb67 (patch) | |
tree | 57a30abfdfccbbde3078bbe7b6d2930c84846c1e | |
parent | 88a4b6c95ddf299d00a32a924f42421e272558c4 (diff) | |
download | gpsd-fcf435a2c28f855f91bc08a6dcab72d0b12bfb67.tar.gz |
Proper integral-type conversion when stashing previous-fix time.
-rw-r--r-- | ppsthread.c | 3 |
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@*/ |