diff options
author | Gary E. Miller <gem@rellim.com> | 2009-12-01 20:18:56 +0000 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2009-12-01 20:18:56 +0000 |
commit | 0c4bd78abbe4a195cf183de9918f49a12de51c74 (patch) | |
tree | 3d36352c87a9b4fe57cf11fa5d4ccc7c3a9551e1 /serial.c | |
parent | 5f2fcfea72b87dc2c03e84f8d7a1b81d378253c2 (diff) | |
download | gpsd-0c4bd78abbe4a195cf183de9918f49a12de51c74.tar.gz |
When shutting down the serial port keep the last baud rate...
...instead of returning to the original one. That way if an autobaud
event or manual speed change occured it is preserved.
This speeds up the next gpsd start as the tty should be on the proper
speed.
Diffstat (limited to 'serial.c')
-rw-r--r-- | serial.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -387,6 +387,13 @@ void gpsd_close(struct gps_device_t *session) } /* this is the clean way to do it */ session->ttyset_old.c_cflag |= HUPCL; + /* keep the most recent baud rate */ + /*@ ignore @*/ + (void)cfsetispeed(&session->ttyset_old, + (speed_t)session->gpsdata.dev.baudrate); + (void)cfsetospeed(&session->ttyset_old, + (speed_t)session->gpsdata.dev.baudrate); + /*@ end @*/ (void)tcsetattr(session->gpsdata.gps_fd,TCSANOW,&session->ttyset_old); (void)close(session->gpsdata.gps_fd); session->gpsdata.gps_fd = -1; |