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 /gpsmon.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 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1258,11 +1258,19 @@ int main(int argc, char **argv) for (;;) { +#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)) + longjmp(terminate, TERM_SELECT_FAILED); +#endif /* EFDS */ continue; case AWAIT_FAILED: longjmp(terminate, TERM_SELECT_FAILED); |