mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-07-26 10:50:00 +02:00
nanosleep patch.
This commit is contained in:
@ -199,7 +199,10 @@ int tm_lua_sleep(lua_State *L)
|
||||
n -= t.tv_sec;
|
||||
t.tv_nsec = (int) (n * 1000000000);
|
||||
if (t.tv_nsec >= 1000000000) t.tv_nsec = 999999999;
|
||||
nanosleep(&t, &r);
|
||||
while (nanosleep(&t, &r) != 0) {
|
||||
t.tv_sec = r.tv_sec;
|
||||
t.tv_nsec = r.tv_nsec;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user