Commit 2af9a1e3 authored by Diego Elio Pettenò's avatar Diego Elio Pettenò

build: use an alternative method for making O_BINARY use conditional.

Instead of creating a new mode altogether, check for the definition of
O_BINARY in the headers, and if missing define it to zero.
Signed-off-by: Diego Elio Pettenò's avatarDiego Elio Pettenò <flameeyes@flameeyes.eu>
parent ffb8bab4
......@@ -52,11 +52,25 @@ AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_CHECK_HEADERS(unistd.h sys/param.h sys/uio.h limits.h pwd.h errno.h)
AC_CHECK_HEADERS([unistd.h sys/param.h sys/uio.h limits.h pwd.h]dnl
[errno.h sys/types.h sys/stat.h fcntl.h io.h])
AC_CHECK_DECL([O_BINARY], [],
[AC_DEFINE([O_BINARY], [0], [Define O_BINARY if missing])],
[
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#if HAVE_FCNTL_H
# include <fcntl.h>
#endif
])
AC_SYS_LARGEFILE
AC_CHECK_HEADERS([sys/stat.h sys/types.h io.h])
AC_CACHE_CHECK(
[for posix mkdir()],
[css_cv_mkdir_posix], [
......
......@@ -480,7 +480,7 @@ int _dvdcss_close ( dvdcss_t dvdcss )
*****************************************************************************/
static int libc_open ( dvdcss_t dvdcss, char const *psz_device )
{
dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, LIBC_OPEN_MODE );
dvdcss->i_fd = dvdcss->i_read_fd = open( psz_device, O_BINARY );
if( dvdcss->i_fd == -1 )
{
......
......@@ -46,9 +46,6 @@ struct iovec
#if !defined(WIN32) && !defined(__OS2__)
# define DVDCSS_RAW_OPEN
# define LIBC_OPEN_MODE 0
#else
# define LIBC_OPEN_MODE O_BINARY
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment