diff options
author | Gary E. Miller <gem@rellim.com> | 2016-08-15 16:53:40 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2016-08-15 16:53:40 -0700 |
commit | e67e4118a0cbb5b5cecc62e7440299d0b5b35a37 (patch) | |
tree | 9aa35686f7b499ae7afd75e6b8b1f25a2aedfb32 /gpsctl.c | |
parent | 1721d7c431aeb471dcd3e36b09c4a432eb31dc5e (diff) | |
download | gpsd-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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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) */ |