summaryrefslogtreecommitdiff
path: root/serial.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-06-14 14:08:02 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-06-14 14:08:02 -0400
commit54b92902b587e3338a1ba43607700008dc0b171d (patch)
tree6bdbbd8272587a5f40b548e320a24ee885e79d67 /serial.c
parent4d558b8b88576270c804e4ff2b48a86e483f6a4e (diff)
downloadgpsd-54b92902b587e3338a1ba43607700008dc0b171d.tar.gz
Recover from zero-length reads.
Rather than deactivating a device the first time it gets a zero-length read, temporarily suppress waiting on it in the main select call and set a timeout after which it will be un-suppressed. A zero-length read after unsuppression will trigger deactivation. All regression tests pass.
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/serial.c b/serial.c
index 499dd3cb..55f0c003 100644
--- a/serial.c
+++ b/serial.c
@@ -72,6 +72,8 @@ void gpsd_tty_init(struct gps_device_t *session)
session->shmTimeP = -1;
# endif /* PPS_ENABLE */
#endif /* NTPSHM_ENABLE */
+ session->zerokill = false;
+ session->reawake = 0;
}
#if defined(__CYGWIN__)