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 /serial.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 'serial.c')
-rw-r--r-- | serial.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -255,6 +255,7 @@ void gpsd_set_speed(struct gps_device_t *session, speed_t speed, char parity, unsigned int stopbits) { speed_t rate; + struct timespec delay; /* * Yes, you can set speeds that aren't in the hunt loop. If you @@ -380,7 +381,11 @@ void gpsd_set_speed(struct gps_device_t *session, * occasional failure to lock. */ (void)tcflush(session->gpsdata.gps_fd, TCIOFLUSH); - (void)usleep(200000); + + /* wait 200,000 uSec */ + delay.tv_sec = 0; + delay.tv_nsec = 200000000L; + nanosleep(&delay, NULL); (void)tcflush(session->gpsdata.gps_fd, TCIOFLUSH); } gpsd_log(&session->context->errout, LOG_INF, |