Fix redbean unix.poll() with -1 timeout

This commit is contained in:
Justine Tunney 2023-06-18 18:05:26 -07:00
parent f10845ab9f
commit fb2bd313ae
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

View file

@ -23,7 +23,11 @@
*/
struct timespec timespec_frommillis(int64_t x) {
struct timespec ts;
if (x >= 0) {
ts.tv_sec = x / 1000;
ts.tv_nsec = x % 1000 * 1000000;
} else {
ts = timespec_max;
}
return ts;
}