[libdvdcss-devel] build: Refactor an instance of system-specific O_BINARY-related ifdeffery

Diego Biurrun git at videolan.org
Thu Feb 14 16:57:35 CET 2013


libdvdcss | branch: master | Diego Biurrun <diego at biurrun.de> | Thu Feb 14 01:32:14 2013 +0100| [dacda2a5596a9a956e7b192c87f9ab8eedb72c43] | committer: Jean-Baptiste Kempf

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

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

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=dacda2a5596a9a956e7b192c87f9ab8eedb72c43
---

 src/device.c |    6 +-----
 src/device.h |    3 +++
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/device.c b/src/device.c
index 09cdca3..e7a648e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -482,11 +482,7 @@ int _dvdcss_close ( dvdcss_t dvdcss )
  *****************************************************************************/
 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 )
     {
diff --git a/src/device.h b/src/device.h
index 6bc0f12..3bcd567 100644
--- a/src/device.h
+++ b/src/device.h
@@ -47,6 +47,9 @@ struct iovec
 
 #if !defined(WIN32) && !defined(__OS2__)
 #   define DVDCSS_RAW_OPEN
+#   define LIBC_OPEN_MODE 0
+#else
+#   define LIBC_OPEN_MODE O_BINARY
 #endif
 
 



More information about the libdvdcss-devel mailing list