Index: gstreamer-vaapi-1.12.2/tests/test-display.c
===================================================================
--- gstreamer-vaapi-1.12.2.orig/tests/test-display.c
+++ gstreamer-vaapi-1.12.2/tests/test-display.c
@@ -54,6 +54,11 @@
 /* Set to 1 to check display cache works (shared VA display) */
 #define CHECK_DISPLAY_CACHE 1
 
+#ifndef O_CLOEXEC
+# define O_CLOEXEC     02000000
+#endif
+
+
 static void
 print_value (const GValue * value, const gchar * name)
 {
Index: gstreamer-vaapi-1.12.2/gst-libs/gst/vaapi/gstvaapidisplay_drm.c
===================================================================
--- gstreamer-vaapi-1.12.2.orig/gst-libs/gst/vaapi/gstvaapidisplay_drm.c
+++ gstreamer-vaapi-1.12.2/gst-libs/gst/vaapi/gstvaapidisplay_drm.c
@@ -42,6 +42,10 @@
 #define DEBUG_VAAPI_DISPLAY 1
 #include "gstvaapidebug.h"
 
+#ifndef O_CLOEXEC
+# define O_CLOEXEC     02000000
+#endif
+
 #define _do_init \
     G_ADD_PRIVATE (GstVaapiDisplayDRM);
 
