[libdvdcss-devel] [PATCH] build: Refactor an instance of system-specific O_BINARY-related ifdeffery
Diego Biurrun
diego at biurrun.de
Thu Feb 14 01:34:07 CET 2013
Signed-off-by: Diego Biurrun <diego at biurrun.de>
---
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
--
1.7.9.5
More information about the libdvdcss-devel
mailing list