util: futex fixes for OpenBSD
authorJonathan Gray <jsg@jsg.id.au>
Thu, 20 Feb 2020 02:18:01 +0000 (13:18 +1100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 31 Aug 2020 09:14:57 +0000 (09:14 +0000)
commitc66c5b38e0ad136aa9301fd60aafea736d433c57
tree300ebddfd975e2ebb9e8451c233092490503f5a8
parent0398caa97fa6ab9a0eac29dfca38b3fceb2cc026
util: futex fixes for OpenBSD

Fix absolute to relative timeout computation.

Add sanity checks to futex_wait()
- handle the NULL timeout pointer case
- avoid negative cases.

From Matthieu Herrb and Scott Cheloha.

Fixes: c91997b6c43 ("util/futex: use futex syscall on OpenBSD")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Acked-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
src/util/futex.h