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 /gpsd.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 'gpsd.c')
-rw-r--r-- | gpsd.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -999,6 +999,7 @@ static void set_serial(struct gps_device_t *device, unsigned int stopbits = device->gpsdata.dev.stopbits; char parity = device->gpsdata.dev.parity; int wordsize = 8; + struct timespec delay; #ifndef __clang_analyzer__ while (isspace((unsigned char) *modestring)) @@ -1041,7 +1042,12 @@ static void set_serial(struct gps_device_t *device, * across any given type of UART. */ (void)tcdrain(device->gpsdata.gps_fd); - (void)usleep(50000); + + /* wait 50,000 uSec */ + delay.tv_sec = 0; + delay.tv_nsec = 50000000L; + nanosleep(&delay, NULL); + gpsd_set_speed(device, speed, parity, stopbits); } } |