Discussion:
[libdvdcss-devel] [PATCH] build: Refactor an instance of system-specific O_BINARY-related ifdeffery
Diego Biurrun
2013-02-14 00:34:07 UTC
Permalink
Signed-off-by: Diego Biurrun <***@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
Diego Biurrun
2013-02-14 15:52:06 UTC
Permalink
libdvdcss | branch: master | Diego Biurrun <***@biurrun.de> | Thu Feb 14 01:32:14 2013 +0100| [0dab19badb7dcbe538b505bdfa10fa2e4df0b775] | committer: Jean-Baptiste Kempf

build: Refactor an instance of system-specific O_BINARY-related ifdeffery
http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=0dab19badb7dcbe538b505bdfa10fa2e4df0b775
---

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
Diego Biurrun
2013-02-14 15:57:35 UTC
Permalink
libdvdcss | branch: master | Diego Biurrun <***@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
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

Loading...