summaryrefslogtreecommitdiff
path: root/gpsctl.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2016-08-15 16:53:40 -0700
committerGary E. Miller <gem@rellim.com>2016-08-15 16:53:40 -0700
commite67e4118a0cbb5b5cecc62e7440299d0b5b35a37 (patch)
tree9aa35686f7b499ae7afd75e6b8b1f25a2aedfb32 /gpsctl.c
parent1721d7c431aeb471dcd3e36b09c4a432eb31dc5e (diff)
downloadgpsd-e67e4118a0cbb5b5cecc62e7440299d0b5b35a37.tar.gz
usleep() is removed from POSIX-2008. Replace with nanosleep()
I sure hope I did not drop a zero anywhere...
Diffstat (limited to 'gpsctl.c')
-rw-r--r--gpsctl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gpsctl.c b/gpsctl.c
index e3835bda..e14c1042 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -43,11 +43,18 @@ static bool hunting = true;
static void settle(struct gps_device_t *session)
/* allow the device to settle after a control operation */
{
+ struct timespec delay;
+
/*
* See the 'deep black magic' comment in serial.c:set_serial().
*/
(void)tcdrain(session->gpsdata.gps_fd);
- (void)usleep(50000);
+
+ /* wait 50,000 uSec */
+ delay.tv_sec = 0;
+ delay.tv_nsec = 50000000L;
+ nanosleep(&delay, NULL);
+
(void)tcdrain(session->gpsdata.gps_fd);
}
#endif /* defined(RECONFIGURE_ENABLE) || defined(CONTROLSEND_ENABLE) */