Skip to content

util: introduce os_dupfd_cloexec() helper, use it in place of F_DUPFD_CLOEXEC, and replace all remaining dup() with it

Eric Engestrom requested to merge eric/mesa:os_dupfd_cloexec into master

Adapted from wayland's wl_os_dupfd_cloexec().

The F_DUPFD_CLOEXEC -> os_dupfd_cloexec() are all squashed into a single commit because it shouldn't have any behaviour change, except that it might work now on platforms where it was broken because F_DUPFD_CLOEXEC is not supported but FD_CLOEXEC is.

The "replace all dup() with os_dupfd_cloexec()" commits are split per module for proper review.

I also needed to replace defined(WIN32) with DETECT_OS_WINDOWS because the meson-windows-vs2019 job was going down the non-windows path and I started putting non-windows stuff in that path, which broke the build. (I'm guessing the native windows build defines _WIN32 but not WIN32)

Merge request reports

Loading