From: Sebastian Lackner Subject: qcap: Fix compile error when O_CLOEXEC is not defined. Message-Id: <2374c012-3b53-87c5-80dd-a4099e865517@fds-team.de> Date: Tue, 7 Mar 2017 16:12:18 +0100 Signed-off-by: Sebastian Lackner --- Defining to 0 ensures that it doesn't do any harm. If we don't care about ancient systems, we can probably also remove the fcntl call. On modern systems, setting CLOEXEC twice (via open and fcntl) shouldn't hurt. 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