summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-12-18 18:24:21 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-12-18 18:24:21 +0000
commitf00b96ea794bed82bc3d0f9b279b5f7cd09547c5 (patch)
tree9bc30141f943a2600f44afed5be3acb31165ebd5
parentd467b5f0eaa04ac482f3117cd7f79e4ff6f73674 (diff)
downloadgpsd-f00b96ea794bed82bc3d0f9b279b5f7cd09547c5.tar.gz
Arrgh. I confused ERR_SET with ERROR_SET in a couple of places.
ERR_SET is now gone entirely, so in the extremely unlikely even that an app developer got caught by this (could never happen unless they shipped a bad command via the deprecated gps_send() entry point) the code will break noisily. All regression tests pass.
-rw-r--r--gps.h1
-rw-r--r--gpsctl.c6
-rw-r--r--libgps_json.c2
-rw-r--r--pseudonmea.c2
4 files changed, 5 insertions, 6 deletions
diff --git a/gps.h b/gps.h
index b1ea5fac..fb208a4c 100644
--- a/gps.h
+++ b/gps.h
@@ -895,7 +895,6 @@ struct gps_data_t {
#define VERR_SET 0x00002000u
#define PERR_SET 0x00004000u
#define POLICY_SET 0x00008000u /* only used in client library */
-#define ERR_SET (HERR_SET|VERR_SET|PERR_SET)
#define SATELLITE_SET 0x00010000u
#define RAW_SET 0x00020000u
#define USED_SET 0x00040000u
diff --git a/gpsctl.c b/gpsctl.c
index bddce433..2e08b6f4 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -77,7 +77,7 @@ static int gps_query(struct gps_data_t *gpsdata, const char *fmt, ... )
}
gpsd_report(LOG_PROG, "gps_query(), wrote, %s\n", buf);
ret = gps_poll(gpsdata);
- if (ERR_SET & gpsdata->set) {
+ if (ERROR_SET & gpsdata->set) {
gpsd_report(LOG_ERROR, "gps_query() error '%s'\n", gpsdata->error);
}
return ret;
@@ -320,7 +320,7 @@ int main(int argc, char **argv)
/*@-boolops@*/
if (to_nmea) {
(void)gps_query(gpsdata, "?DEVICE={\"path\":\"%s\",\"native\":0}\r\n", device);
- if ((gpsdata->set & ERR_SET) || (gpsdata->dev.driver_mode != MODE_NMEA)) {
+ if ((gpsdata->set & ERROR_SET) || (gpsdata->dev.driver_mode != MODE_NMEA)) {
gpsd_report(LOG_ERROR, "%s mode change to NMEA failed\n", gpsdata->dev.path);
status = 1;
} else
@@ -328,7 +328,7 @@ int main(int argc, char **argv)
}
else if (to_binary) {
(void)gps_query(gpsdata, "?DEVICE={\"path\":\"%s\",\"native\":1}\r\n", device);
- if ((gpsdata->set & ERR_SET) || (gpsdata->dev.driver_mode != MODE_BINARY)) {
+ if ((gpsdata->set & ERROR_SET) || (gpsdata->dev.driver_mode != MODE_BINARY)) {
gpsd_report(LOG_ERROR, "%s mode change to native mode failed\n", gpsdata->dev.path);
status = 1;
} else
diff --git a/libgps_json.c b/libgps_json.c
index 8c635a67..8e42b0ed 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -273,7 +273,7 @@ static int json_error_read(const char *buf,
return status;
gpsdata->set &=~ UNION_SET;
- gpsdata->set |= ERR_SET;
+ gpsdata->set |= ERROR_SET;
return 0;
}
diff --git a/pseudonmea.c b/pseudonmea.c
index 38d21aa3..26c785e4 100644
--- a/pseudonmea.c
+++ b/pseudonmea.c
@@ -234,7 +234,7 @@ void nmea_tpv_dump(struct gps_device_t *session,
gpsd_position_fix_dump(session, bufp, len);
gpsd_transit_fix_dump(session, bufp + strlen(bufp), len - strlen(bufp));
}
- if ((session->gpsdata.set & (MODE_SET | DOP_SET | USED_SET | ERR_SET)) != 0)
+ if ((session->gpsdata.set & (MODE_SET | DOP_SET | USED_SET | HERR_SET | VERR_SET)) != 0)
gpsd_binary_quality_dump(session, bufp+strlen(bufp), len-strlen(bufp));
}