summaryrefslogtreecommitdiff
path: root/garmin.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-11-01 19:15:13 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-11-01 19:15:13 +0000
commit95babe14d50e989dc7e345e5238d048027d9ba29 (patch)
tree77f407f49cfc1c5258561c0525308a1491dc4862 /garmin.c
parentba6cb373cb547dae6be27f1aad7867ae5800d915 (diff)
downloadgpsd-95babe14d50e989dc7e345e5238d048027d9ba29.tar.gz
Pure refactoring.
Give serial.c a new entry point so storage for TTY settings can stay private to serial.c rather than being tweaked in the Garmin driver.
Diffstat (limited to 'garmin.c')
-rw-r--r--garmin.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/garmin.c b/garmin.c
index 8351ccd7..37e6cd2c 100644
--- a/garmin.c
+++ b/garmin.c
@@ -740,17 +740,7 @@ static bool garmin_detect(struct gps_device_t *session)
return false;
}
- /* Save original terminal parameters */
- if (tcgetattr(session->gpsdata.gps_fd,&session->ttyset_old) != 0) {
- gpsd_report(0, "garmin_detect: error getting port attributes: %s\n",
- strerror(errno));
- return false;
- }
- memcpy(&session->ttyset,&session->ttyset_old,sizeof(session->ttyset));
-
- (void)cfmakeraw(&session->ttyset);
-
- if (tcsetattr( session->gpsdata.gps_fd, TCIOFLUSH, &session->ttyset) < 0) {
+ if (!gpsd_set_raw(session)) {
gpsd_report(0, "garmin_detect: error changing port attributes: %s\n",
strerror(errno));
return false;