diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 11:51:15 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 11:51:15 -0500 |
commit | df34a3add8df382eb852a67635c6859ee8cc657f (patch) | |
tree | c52183ba41403d093ad1ac971fa45c4ba1289f0c /net_dgpsip.c | |
parent | 9c49083f2afe799343a610912b0ed404b2ffad05 (diff) | |
download | gpsd-df34a3add8df382eb852a67635c6859ee8cc657f.tar.gz |
gpsd-report() -> gpsd_log()
This change is done so we can add a "log" hook to the pps_thread_t
structure (this is not done yet) and harmonize with the name of the
outer logging function. If that name had been left as gpsd_report()
there would have been scope for bad confusion with the report_hook
member.
Also, remove two stray duplicative printf calls from the NMEA2000 driver
(drivers shouldn't have printfs!) and fix one typo.
This is a step towards factoring out ntplib. For that to happen, the
PPS thread code needs to be decoupled from the core session structure.
No logic changes. Object compatibility preserved. All regression tests pass.
Diffstat (limited to 'net_dgpsip.c')
-rw-r--r-- | net_dgpsip.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/net_dgpsip.c b/net_dgpsip.c index dc596efa..3574125b 100644 --- a/net_dgpsip.c +++ b/net_dgpsip.c @@ -37,21 +37,21 @@ int dgpsip_open(struct gps_device_t *device, const char *dgpsserver) // cppcheck-suppress pointerPositive if (device->gpsdata.gps_fd >= 0) { char hn[256], buf[BUFSIZ]; - gpsd_report(&device->context->errout, LOG_PROG, - "connection to DGPS server %s established.\n", - dgpsserver); + gpsd_log(&device->context->errout, LOG_PROG, + "connection to DGPS server %s established.\n", + dgpsserver); (void)gethostname(hn, sizeof(hn)); /* greeting required by some RTCM104 servers; others will ignore it */ (void)snprintf(buf, sizeof(buf), "HELO %s gpsd %s\r\nR\r\n", hn, VERSION); if (write(device->gpsdata.gps_fd, buf, strlen(buf)) != (ssize_t) strlen(buf)) - gpsd_report(&device->context->errout, LOG_ERROR, - "hello to DGPS server %s failed\n", - dgpsserver); + gpsd_log(&device->context->errout, LOG_ERROR, + "hello to DGPS server %s failed\n", + dgpsserver); } else - gpsd_report(&device->context->errout, LOG_ERROR, - "can't connect to DGPS server %s, netlib error %d.\n", - dgpsserver, device->gpsdata.gps_fd); + gpsd_log(&device->context->errout, LOG_ERROR, + "can't connect to DGPS server %s, netlib error %d.\n", + dgpsserver, device->gpsdata.gps_fd); opts = fcntl(device->gpsdata.gps_fd, F_GETFL); if (opts >= 0) @@ -81,9 +81,9 @@ void dgpsip_report(struct gps_context_t *context, gps->gpsdata.fix.altitude); if (write(dgpsip->gpsdata.gps_fd, buf, strlen(buf)) == (ssize_t) strlen(buf)) - gpsd_report(&context->errout, LOG_IO, "=> dgps %s\n", buf); + gpsd_log(&context->errout, LOG_IO, "=> dgps %s\n", buf); else - gpsd_report(&context->errout, LOG_IO, "write to dgps FAILED\n"); + gpsd_log(&context->errout, LOG_IO, "write to dgps FAILED\n"); } } } |