diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 45eaad20..ce22d88d 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -293,6 +293,7 @@ patch_enable_all () enable_oleaut32_x86_64_Marshaller="$1" enable_opengl32_Revert_Disable_Ext="$1" enable_opengl32_glDebugMessageCallback="$1" + enable_qcap_O_CLOEXEC="$1" enable_quartz_MediaSeeking_Positions="$1" enable_quartz_Silence_FIXMEs="$1" enable_rasapi32_RasEnumDevicesA="$1" @@ -1098,6 +1099,9 @@ patch_enable () opengl32-glDebugMessageCallback) enable_opengl32_glDebugMessageCallback="$2" ;; + qcap-O_CLOEXEC) + enable_qcap_O_CLOEXEC="$2" + ;; quartz-MediaSeeking_Positions) enable_quartz_MediaSeeking_Positions="$2" ;; @@ -6418,6 +6422,21 @@ if test "$enable_opengl32_glDebugMessageCallback" -eq 1; then ) >> "$patchlist" fi +# Patchset qcap-O_CLOEXEC +# | +# | This patchset fixes the following Wine bugs: +# | * [#42478] Fix compile error when O_CLOEXEC is not defined +# | +# | Modified files: +# | * dlls/qcap/v4l.c +# | +if test "$enable_qcap_O_CLOEXEC" -eq 1; then + patch_apply qcap-O_CLOEXEC/0001-qcap-Fix-compile-error-when-O_CLOEXEC-is-not-defined.patch + ( + printf '%s\n' '+ { "Sebastian Lackner", "qcap: Fix compile error when O_CLOEXEC is not defined.", 1 },'; + ) >> "$patchlist" +fi + # Patchset quartz-MediaSeeking_Positions # | # | Modified files: diff --git a/patches/qcap-O_CLOEXEC/0001-qcap-Fix-compile-error-when-O_CLOEXEC-is-not-defined.patch b/patches/qcap-O_CLOEXEC/0001-qcap-Fix-compile-error-when-O_CLOEXEC-is-not-defined.patch new file mode 100644 index 00000000..e6564620 --- /dev/null +++ b/patches/qcap-O_CLOEXEC/0001-qcap-Fix-compile-error-when-O_CLOEXEC-is-not-defined.patch @@ -0,0 +1,35 @@ +From 9cdd8a9d8249736dc06f43edb70ca52a7ac63851 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 5 Mar 2017 19:37:00 +0100 +Subject: qcap: Fix compile error when O_CLOEXEC is not defined. + +--- + dlls/qcap/v4l.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c +index d67df73b0cd..bbe3a8b1da5 100644 +--- a/dlls/qcap/v4l.c ++++ b/dlls/qcap/v4l.c +@@ -71,6 +71,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap_v4l); + + #ifdef VIDIOCMCAPTURE + ++#ifndef O_CLOEXEC ++#define O_CLOEXEC 0 ++#endif ++ + static typeof(open) *video_open = open; + static typeof(close) *video_close = close; + static typeof(ioctl) *video_ioctl = ioctl; +@@ -806,6 +810,7 @@ Capture * qcap_driver_init( IPin *pOut, USHORT card ) + goto error; + } + ++ fcntl(capBox->fd, F_SETFD, FD_CLOEXEC); + memset(&capa, 0, sizeof(capa)); + + if (xioctl(capBox->fd, VIDIOCGCAP, &capa) == -1) +-- +2.11.0 + diff --git a/patches/qcap-O_CLOEXEC/definition b/patches/qcap-O_CLOEXEC/definition new file mode 100644 index 00000000..4f8feb36 --- /dev/null +++ b/patches/qcap-O_CLOEXEC/definition @@ -0,0 +1 @@ +Fixes: [42478] Fix compile error when O_CLOEXEC is not defined