diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-06-14 14:08:02 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-06-14 14:08:02 -0400 |
commit | 54b92902b587e3338a1ba43607700008dc0b171d (patch) | |
tree | 6bdbbd8272587a5f40b548e320a24ee885e79d67 /serial.c | |
parent | 4d558b8b88576270c804e4ff2b48a86e483f6a4e (diff) | |
download | gpsd-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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__) |