Merge branch 'master' into 'master'

fix(poll): handle overflow in ppoll timeout

See merge request redox-os/relibc!929
This commit is contained in:
Jeremy Soller
2026-01-30 06:05:40 -07:00
+5 -2
View File
@@ -167,8 +167,11 @@ pub unsafe extern "C" fn ppoll(
-1
} else {
let tmo = unsafe { &*tmo_p };
//TODO: handle overflow
((tmo.tv_sec as c_int) * 1000) + ((tmo.tv_nsec as c_int) / 1000000)
if tmo.tv_sec > (c_int::MAX / 1000) as _ {
c_int::MAX
} else {
((tmo.tv_sec as c_int) * 1000) + ((tmo.tv_nsec as c_int) / 1000000)
}
};
trace_expr!(
poll_epoll(