diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2018-12-26 13:23:04 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2018-12-26 13:23:04 -0500 |
commit | 5517175ed53b877720fdf5a1a4085386b40c4590 (patch) | |
tree | 31c1ce53dea117cfb36a1e7d679cb785b32abdf8 /driver_tsip.c | |
parent | c9e81aabcf2f5c6886be1fd0e859ceb63470e06f (diff) | |
download | gpsd-5517175ed53b877720fdf5a1a4085386b40c4590.tar.gz |
Eliminate effectively all uses of struct timeval.
Outide of one Mac portability shim, anyway. Associated select(2) calls
become pselect(2) calls.
Diffstat (limited to 'driver_tsip.c')
-rw-r--r-- | driver_tsip.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/driver_tsip.c b/driver_tsip.c index 70adbd7c..e6252027 100644 --- a/driver_tsip.c +++ b/driver_tsip.c @@ -23,7 +23,7 @@ #endif /* __linux__ */ -#include <sys/time.h> /* for select() */ +#include <sys/time.h> /* for pselect() */ #include <string.h> #include <stdio.h> #include <stdbool.h> @@ -83,7 +83,7 @@ static bool tsip_detect(struct gps_device_t *session) bool ret = false; int myfd; fd_set fdset; - struct timeval to; + struct timespec to; speed_t old_baudrate; char old_parity; unsigned int old_stopbits; @@ -105,8 +105,8 @@ static bool tsip_detect(struct gps_device_t *session) FD_ZERO(&fdset); FD_SET(myfd, &fdset); to.tv_sec = 1; - to.tv_usec = 0; - if (select(myfd + 1, &fdset, NULL, NULL, &to) != 1) + to.tv_nsec = 0; + if (pselect(myfd + 1, &fdset, NULL, NULL, &to, NULL) != 1) break; if (generic_get(session) >= 0) { if (session->lexer.type == TSIP_PACKET) { |