diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2007-10-18 03:05:04 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2007-10-18 03:05:04 +0000 |
commit | c86da7183a4307525e136269b46d6244252c53bf (patch) | |
tree | e47313803de57a19bc0ed4978967e53dcb618773 /gpsd.c | |
parent | 943efb28832d6613086073b7e3d21d9ac58ec0ae (diff) | |
download | gpsd-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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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, |