diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2014-08-18 01:48:48 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2014-08-18 01:49:51 -0400 |
commit | 117b8c2fcc577ec6eb1730fb554c91ab081f2cf5 (patch) | |
tree | ae90c19d647ee2a1f54d140968869f786b086a88 /gpsctl.c | |
parent | b936bbc26412a1666c5bf8659c220dfaa158bd55 (diff) | |
download | gpsd-117b8c2fcc577ec6eb1730fb554c91ab081f2cf5.tar.gz |
Attempt to recover from EBADF in the main select.
All regression tests pass.
Diffstat (limited to 'gpsctl.c')
-rw-r--r-- | gpsctl.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -664,11 +664,19 @@ int main(int argc, char **argv) /* grab packets until we time out, get sync, or fail sync */ for (hunting = true; hunting; ) { +#ifdef EFDS + fd_set efds; +#endif /* EFDS */ switch(gpsd_await_data(&rfds, maxfd, &all_fds, context.debug)) { case AWAIT_GOT_INPUT: break; case AWAIT_NOT_READY: +#ifdef EFDS + /* no recovery from bad fd is possible */ + if (FD_ISSET(session.gpsdata.gps_fd, &efds)) + exit(EXIT_FAILURE); +#endif /* EFDS */ continue; case AWAIT_FAILED: exit(EXIT_FAILURE); |