Blob Blame History Raw
From 532a41c8fb4a31db10fb29554d51f9f50ba615d3 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones@redhat.com>
Date: Mon, 11 Mar 2013 11:03:55 +0000
Subject: [PATCH 38/38] RHEL 5: tests/xml: Define O_CLOEXEC in LD_PRELOAD library.

---
 tests/xml/fake-libvirt-xml.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tests/xml/fake-libvirt-xml.c b/tests/xml/fake-libvirt-xml.c
index a34b700..b7ab7a8 100644
--- a/tests/xml/fake-libvirt-xml.c
+++ b/tests/xml/fake-libvirt-xml.c
@@ -25,6 +25,15 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+/* We're not using gnulib here so that we don't have to link to gnulib
+ * rpl_* libraries (not possible since this is an LD_PRELOAD lib).
+ * However that does mean we have to define O_CLOEXEC explicitly for
+ * RHEL 5.
+ */
+#ifndef O_CLOEXEC
+#define O_CLOEXEC 0
+#endif
+
 /* Old <libvirt.h> had a slightly different definition of
  * virDomainGetXMLDesc (using 'int' for flags instead of 'unsigned
  * int').  To avoid an error trying to redefine it with a different
-- 
1.7.4.1