summaryrefslogtreecommitdiff
path: root/timebase.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2014-08-27 16:26:52 -0400
committerEric S. Raymond <esr@thyrsus.com>2014-08-27 16:26:52 -0400
commit6203e5b8fcac9d78ea54b7b3c53cb8d084e8a219 (patch)
treed8611d8e44267151c29ab8920702cc94e86063c5 /timebase.c
parentb53db1322c70f8b86dfe72e982d6097304a749ae (diff)
downloadgpsd-6203e5b8fcac9d78ea54b7b3c53cb8d084e8a219.tar.gz
Introduce struct errout_t to encapsulate error-reporting hooks.
A major step towards eliminating reverse linkage. All regression tests pass.
Diffstat (limited to 'timebase.c')
-rw-r--r--timebase.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/timebase.c b/timebase.c
index 5c494f14..ec80f9f3 100644
--- a/timebase.c
+++ b/timebase.c
@@ -222,7 +222,7 @@ void gpsd_time_init(struct gps_context_t *context, time_t starttime)
context->rollovers = (int)((context->start_time-GPS_EPOCH) / GPS_ROLLOVER);
if (context->start_time < GPS_EPOCH)
- gpsd_report(context->debug, LOG_ERROR,
+ gpsd_report(context->errout.debug, LOG_ERROR,
"system time looks bogus, dates may not be reliable.\n");
else {
/* we've forced the UTC timezone, so this is actually UTC */
@@ -235,7 +235,7 @@ void gpsd_time_init(struct gps_context_t *context, time_t starttime)
now->tm_year += 1900;
context->century = now->tm_year - (now->tm_year % 100);
(void)unix_to_iso8601((timestamp_t)context->start_time, scr, sizeof(scr));
- gpsd_report(context->debug, LOG_INF,
+ gpsd_report(context->errout.debug, LOG_INF,
"startup at %s (%d)\n",
scr, (int)context->start_time);
}
@@ -290,7 +290,7 @@ timestamp_t gpsd_utc_resolve(/*@in@*/struct gps_device_t *session)
if (session->newdata.time < (timestamp_t)session->context->start_time) {
char scr[128];
(void)unix_to_iso8601(session->newdata.time, scr, sizeof(scr));
- gpsd_report(session->context->debug, LOG_WARN,
+ gpsd_report(session->context->errout.debug, LOG_WARN,
"GPS week rollover makes time %s (%f) invalid\n",
scr, session->newdata.time);
}
@@ -309,14 +309,14 @@ void gpsd_century_update(/*@in@*/struct gps_device_t *session, int century)
* certainly it means that a century mark has passed while
* gpsd was running, and we should trust the new ZDA year.
*/
- gpsd_report(session->context->debug, LOG_WARN,
+ gpsd_report(session->context->errout.debug, LOG_WARN,
"century rollover detected.\n");
session->context->century = century;
} else if (session->context->start_time >= GPS_EPOCH && century < session->context->century) {
/*
* This looks like a GPS week-counter rollover.
*/
- gpsd_report(session->context->debug, LOG_WARN,
+ gpsd_report(session->context->errout.debug, LOG_WARN,
"ZDA year less than clock year, "
"probable GPS week rollover lossage\n");
session->context->valid &=~ CENTURY_VALID;
@@ -337,7 +337,7 @@ timestamp_t gpsd_gpstime_resolve(/*@in@*/struct gps_device_t *session,
* to 13 bits.
*/
if ((int)week < (session->context->gps_week & 0x3ff)) {
- gpsd_report(session->context->debug, LOG_INF,
+ gpsd_report(session->context->errout.debug, LOG_INF,
"GPS week 10-bit rollover detected.\n");
++session->context->rollovers;
}