From 5517175ed53b877720fdf5a1a4085386b40c4590 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 26 Dec 2018 13:23:04 -0500 Subject: Eliminate effectively all uses of struct timeval. Outide of one Mac portability shim, anyway. Associated select(2) calls become pselect(2) calls. --- driver_tsip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'driver_tsip.c') 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 /* for select() */ +#include /* for pselect() */ #include #include #include @@ -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) { -- cgit v1.2.1