[vlc-devel] [PATCH] O_DIRECTORY workaround in vlc_fixups.h

Maciej Blizinski maciej at opencsw.org
Wed Feb 29 17:09:59 CET 2012


When not defined, set the value to 0.
Fixes a gnutls.c build issue on Solaris 10, which doesn't have O_DIRECTORY.

Ref: http://mailman.videolan.org/pipermail/vlc-devel/2012-February/086933.html
---
 modules/misc/gnutls.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index d52d3ec..6299a31 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -58,6 +58,21 @@
 #include <assert.h>
 
 /*****************************************************************************
+ * Portability issues
+ *****************************************************************************/
+
+/* O_DIRECTORY is a constant introduced in POSIX.1-2008, not present on some
+ * platforms.
+ *
+ * Ref:
+ *   http://lists.opencsw.org/pipermail/devel/2012-February/022302.html
+ *   http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html
+ */
+#ifndef O_DIRECTORY
+#define O_DIRECTORY 0
+#endif
+
+/*****************************************************************************
  * Module descriptor
  *****************************************************************************/
 static int  OpenClient  (vlc_tls_t *, int, const char *);
-- 
1.7.5.4




More information about the vlc-devel mailing list