Skip to content

util/os_file: dont assign cloexec when previously assigned (nouveau targeted fix)

Yusuf Khan requested to merge YusufKhan-gamedev/mesa:nouveau/dupfd_fix into main

The EGL_MESA_platform_gbm example code placed inside the EGL reg can crash in nouveau as gbm_create_device is passed with a fd that already has FD_CLOEXEC and nouveau attempts to add FD_CLOEXEC to everything passed to it which just leads to nouveau using a bad fd. Check to make sure cloexec is not assigned before assiging it when duplicating fds with the flag.

Signed-off-by: Yusuf Khan yusisamerican@gmail.com

Merge request reports