From 54b92902b587e3338a1ba43607700008dc0b171d Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 14 Jun 2010 14:08:02 -0400 Subject: 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. --- serial.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'serial.c') 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__) -- cgit v1.2.1