7dd7917b65e0dccf5d43be818308a95edadad4a4
[buildroot.git] /
1 From 4f305f30c9917f7a6ea7332a798401f2a5abe981 Mon Sep 17 00:00:00 2001
2 From: Peter Korsgaard <peter@korsgaard.com>
3 Date: Fri, 4 Oct 2013 13:34:09 +0200
4 Subject: [PATCH] gstv4l2bufferpool: O_CLOEXEC needs _GNU_SOURCE
5
6 [Submitted upstream: https://bugzilla.gnome.org/show_bug.cgi?id=709423]
7
8 On some systems (E.G. uClibc and older Glibc versions), O_CLOEXEC is only
9 defined when _GNU_SOURCE is specified, so do so.
10
11 _GNU_SOURCE needs to be defined before any system headers are included,
12 so move the fcntl.h section up.
13
14 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
15 ---
16 sys/v4l2/gstv4l2bufferpool.c | 10 +++++++---
17 1 file changed, 7 insertions(+), 3 deletions(-)
18
19 diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c
20 index 00c6086..f5396d9 100644
21 --- a/sys/v4l2/gstv4l2bufferpool.c
22 +++ b/sys/v4l2/gstv4l2bufferpool.c
23 @@ -26,13 +26,17 @@
24 # include <config.h>
25 #endif
26
27 -#include <sys/mman.h>
28 -#include <string.h>
29 -#include <unistd.h>
30 #if HAVE_DECL_V4L2_MEMORY_DMABUF
31 +#ifndef _GNU_SOURCE
32 +# define _GNU_SOURCE /* O_CLOEXEC */
33 +#endif
34 #include <fcntl.h>
35 #endif
36
37 +#include <sys/mman.h>
38 +#include <string.h>
39 +#include <unistd.h>
40 +
41 #include "gst/video/video.h"
42 #include "gst/video/gstvideometa.h"
43 #include "gst/video/gstvideopool.h"
44 --
45 1.7.10.4
46