summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2016-05-25 16:53:33 -0700
committerGary E. Miller <gem@rellim.com>2016-05-25 16:54:42 -0700
commit56a2a6eb494c6dbc454bad518df8861c9258ad5b (patch)
tree7bacb2bf58a54a916f15bbc1195f20e96a34fac2 /serial.c
parentedb950b99281dc6366ce1634cc8e73a5902a2d66 (diff)
downloadgpsd-56a2a6eb494c6dbc454bad518df8861c9258ad5b.tar.gz
Do not try to set the speed on non-tty's.
isatty() says a /dev/pts is a tty, but /dev/pts will not accept ttyset speed changes.
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/serial.c b/serial.c
index c6fa27ea..cc8097f9 100644
--- a/serial.c
+++ b/serial.c
@@ -419,6 +419,7 @@ int gpsd_serial_open(struct gps_device_t *session)
*/
{
+ bool no_ttyset = false;
mode_t mode = (mode_t) O_RDWR;
session->sourcetype = gpsd_classify(session->gpsdata.dev.path);
@@ -529,6 +530,7 @@ int gpsd_serial_open(struct gps_device_t *session)
return UNALLOCATED_FD;
}
#endif /* __linux__ */
+ no_ttyset = true;
}
#ifdef FIXED_PORT_SPEED
@@ -547,7 +549,9 @@ int gpsd_serial_open(struct gps_device_t *session)
}
session->lexer.type = BAD_PACKET;
- if (isatty(session->gpsdata.gps_fd) != 0) {
+ if ( 0 != isatty(session->gpsdata.gps_fd) && false == no_ttyset ) {
+
+ /* twiddle the speed, parity, etc. but only on real serial ports */
memset(session->ttyset.c_cc, 0, sizeof(session->ttyset.c_cc));
//session->ttyset.c_cc[VTIME] = 1;
/*