shithub: libdvdcss

Download patch

ref: dacda2a5596a9a956e7b192c87f9ab8eedb72c43
parent: 45b27b0629da78813838f6bcdaaf5421490ba44a
author: Diego Biurrun <diego@biurrun.de>
date: Wed Feb 13 20:32:14 EST 2013

build: Refactor an instance of system-specific O_BINARY-related ifdeffery

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>

--- a/src/device.c
+++ b/src/device.c
@@ -482,11 +482,7 @@
  *****************************************************************************/
 static int libc_open ( dvdcss_t dvdcss, char const *psz_device )
 {
-#if !defined( WIN32 ) && !defined( __OS2__ )
-    dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, 0 );
-#else
-    dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, O_BINARY );
-#endif
+    dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, LIBC_OPEN_MODE );
 
     if( dvdcss->i_fd == -1 )
     {
--- a/src/device.h
+++ b/src/device.h
@@ -47,6 +47,9 @@
 
 #if !defined(WIN32) && !defined(__OS2__)
 #   define DVDCSS_RAW_OPEN
+#   define LIBC_OPEN_MODE 0
+#else
+#   define LIBC_OPEN_MODE O_BINARY
 #endif