Allow using nanosleep in hl_usleep

pull/1302/head
Mike Black W9MDB 2023-05-14 13:52:05 -05:00
rodzic fa9948b17d
commit 5e8de57f54
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -60,8 +60,14 @@ int hl_usleep(rig_useconds_t usec)
retval = usleep(1000000);
usec -= 1000000;
}
#ifdef HAVE_NANOSLEEP
struct timespec t, tleft;
t.tv_sec = usec/1e6;
t.tv_nsec = (usec - (t.tv_sec*1e6)) * 1e3;
return nanosleep(&t, &tleft);
#else
return usleep(usec);
#endif
}
#ifdef HAVE_NANOSLEEP