Module: wine Branch: master Commit: bcc36abd8886f035652630fa62bd732519c83d9a URL: http://source.winehq.org/git/wine.git/?a=commit;h=bcc36abd8886f035652630fa62...
Author: Alexandre Julliard julliard@winehq.org Date: Wed May 10 13:08:57 2017 -0500
qcap: Fix build when O_CLOEXEC isn't defined.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/qcap/v4l.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c index d67df73..b4b7b96 100644 --- a/dlls/qcap/v4l.c +++ b/dlls/qcap/v4l.c @@ -799,12 +799,16 @@ Capture * qcap_driver_init( IPin *pOut, USHORT card )
sprintf(device, "/dev/video%i", card); TRACE("opening %s\n", device); - capBox->fd = video_open(device, O_RDWR | O_NONBLOCK | O_CLOEXEC); +#ifdef O_CLOEXEC + if ((capBox->fd = video_open(device, O_RDWR | O_NONBLOCK | O_CLOEXEC)) == -1 && errno == EINVAL) +#endif + capBox->fd = video_open(device, O_RDWR | O_NONBLOCK); if (capBox->fd == -1) { WARN("open failed (%d)\n", errno); goto error; } + fcntl( capBox->fd, F_SETFD, FD_CLOEXEC ); /* in case O_CLOEXEC isn't supported */
memset(&capa, 0, sizeof(capa));