v4l2bufferpool: O_CLOEXEC needs _GNU_SOURCE
authorPeter Korsgaard <peter@korsgaard.com>
Fri, 4 Oct 2013 11:34:09 +0000 (13:34 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Fri, 4 Oct 2013 12:33:43 +0000 (14:33 +0200)
On some systems (E.G. uClibc and older Glibc versions), O_CLOEXEC is only
defined when _GNU_SOURCE is specified, so do so.

_GNU_SOURCE needs to be defined before any system headers are included,
so move the fcntl.h section up.

https://bugzilla.gnome.org/show_bug.cgi?id=709423

sys/v4l2/gstv4l2bufferpool.c

index 00c6086aa01031d8e430d959aa7de1a0f8ca9d46..f5396d93f6b7262f43613bdb1687d1ae8e637778 100644 (file)
 #  include <config.h>
 #endif
 
-#include <sys/mman.h>
-#include <string.h>
-#include <unistd.h>
 #if HAVE_DECL_V4L2_MEMORY_DMABUF
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE            /* O_CLOEXEC */
+#endif
 #include <fcntl.h>
 #endif
 
+#include <sys/mman.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "gst/video/video.h"
 #include "gst/video/gstvideometa.h"
 #include "gst/video/gstvideopool.h"