summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2007-10-18 03:05:04 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2007-10-18 03:05:04 +0000
commitc86da7183a4307525e136269b46d6244252c53bf (patch)
treee47313803de57a19bc0ed4978967e53dcb618773 /gpsd.c
parent943efb28832d6613086073b7e3d21d9ac58ec0ae (diff)
downloadgpsd-c86da7183a4307525e136269b46d6244252c53bf.tar.gz
d'oh. thanks to my amd64 for reminding me that i need to cache the device
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gpsd.c b/gpsd.c
index 880e671b..437bb6f2 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1269,6 +1269,7 @@ int main(int argc, char *argv[])
struct gps_device_t *gps;
#endif /* RTCM104_SERVICE */
struct subscriber_t *sub;
+ struct gps_device_t *testdevice = NULL;
#ifdef PPS_ENABLE
pthread_mutex_init(&report_mutex, NULL);
@@ -1474,9 +1475,12 @@ int main(int argc, char *argv[])
struct gps_device_t *device = open_device(argv[i]);
if (!device) {
gpsd_report(LOG_ERROR, "GPS device %s nonexistent or can't be read\n", argv[i]);
- }
+ } else if (context.testmode && testdevice == NULL)
+ testdevice = device;
}
+
+
while (0 == signalled) {
(void)memcpy((char *)&rfds, (char *)&all_fds, sizeof(rfds));
@@ -1689,7 +1693,8 @@ int main(int argc, char *argv[])
&sub->fixbuffer, &sub->oldfix);
}
}
- if (context.testmode && sub->device){
+ if (context.testmode) {
+ sub->device = testdevice;
gps_merge_fix(&sub->fixbuffer, changed,
&sub->device->gpsdata.fix);
gpsd_error_model(sub->device, &sub->fixbuffer,