mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
Allow longer sleeps than a second.
This commit is contained in:
@@ -60,6 +60,11 @@ static void ms_sleep(unsigned ms)
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_nsec = ms * 1000 * 1000;
|
||||
|
||||
while(tv.tv_nsec >= 1000000000) {
|
||||
tv.tv_nsec -= 1000000000;
|
||||
tv.tv_sec++;
|
||||
}
|
||||
|
||||
nanosleep(&tv, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user