From 6e25b3318654c868e668c8f5eab9fb738386b9a7 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 1 Apr 2018 21:03:21 -0300 Subject: [PATCH] Fix travis linux compile --- src/RageFileDriverDirect.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/RageFileDriverDirect.cpp b/src/RageFileDriverDirect.cpp index 1b08e477bf..5c55124b60 100644 --- a/src/RageFileDriverDirect.cpp +++ b/src/RageFileDriverDirect.cpp @@ -57,7 +57,7 @@ static RageFileObjDirect *MakeFileObjDirect( RString sPath, int iMode, int &iErr int iFD; if( (iMode & RageFile::READ) != 0 ) { - iFD = _open( sPath, O_BINARY|O_RDONLY, 0666 ); + iFD = open( sPath, O_BINARY|O_RDONLY, 0666 ); /* XXX: Windows returns EACCES if we try to open a file on a CDROM that isn't * ready, instead of something like ENODEV. We want to return that case as @@ -72,7 +72,7 @@ static RageFileObjDirect *MakeFileObjDirect( RString sPath, int iMode, int &iErr sOut = MakeTempFilename(sPath); /* Open a temporary file for writing. */ - iFD = _open( sOut, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0666 ); + iFD = open( sOut, O_BINARY|O_WRONLY|O_CREAT|O_TRUNC, 0666 ); } if( iFD == -1 ) @@ -161,7 +161,7 @@ bool RageFileDriverDirect::Remove( const RString &sPath_ ) case RageFileManager::TYPE_DIR: TRACE( ssprintf("rmdir '%s'", (m_sRoot + sPath).c_str()) ); - if( _rmdir(m_sRoot + sPath) == -1 ) + if( rmdir(m_sRoot + sPath) == -1 ) { WARN( ssprintf("rmdir(%s) failed: %s", (m_sRoot + sPath).c_str(), strerror(errno)) ); return false; @@ -185,7 +185,7 @@ RageFileObjDirect *RageFileObjDirect::Copy() const if( ret == NULL ) RageException::Throw( "Couldn't reopen \"%s\": %s", m_sPath.c_str(), strerror(iErr) ); - ret->Seek( static_cast(_lseek( m_iFD, 0, SEEK_CUR )) ); + ret->Seek( static_cast(lseek( m_iFD, 0, SEEK_CUR )) ); return ret; } @@ -300,7 +300,7 @@ RageFileObjDirect::~RageFileObjDirect() if( m_iFD != -1 ) { - if( _close( m_iFD ) == -1 ) + if( close( m_iFD ) == -1 ) { WARN( ssprintf("Error closing %s: %s", this->m_sPath.c_str(), strerror(errno)) ); SetError( strerror(errno) ); @@ -369,7 +369,7 @@ RageFileObjDirect::~RageFileObjDirect() int RageFileObjDirect::ReadInternal( void *pBuf, size_t iBytes ) { - int iRet = _read( m_iFD, pBuf, iBytes ); + int iRet = read( m_iFD, pBuf, iBytes ); if( iRet == -1 ) { SetError( strerror(errno) ); @@ -385,7 +385,7 @@ static int RetriedWrite( int iFD, const void *pBuf, size_t iCount ) int iTries = 3, iRet; do { - iRet = _write( iFD, pBuf, iCount ); + iRet = write( iFD, pBuf, iCount ); } while( iRet == -1 && errno == EINTR && iTries-- ); @@ -426,16 +426,16 @@ int RageFileObjDirect::WriteInternal( const void *pBuf, size_t iBytes ) int RageFileObjDirect::SeekInternal( int iOffset ) { - return static_cast(_lseek( m_iFD, iOffset, SEEK_SET )); + return static_cast(lseek( m_iFD, iOffset, SEEK_SET )); } int RageFileObjDirect::GetFileSize() const { - const long iOldPos = _lseek( m_iFD, 0, SEEK_CUR ); + const long iOldPos = lseek( m_iFD, 0, SEEK_CUR ); ASSERT_M( iOldPos != -1, ssprintf("\"%s\": %s", m_sPath.c_str(), strerror(errno)) ); - const int iRet = static_cast(_lseek( m_iFD, 0, SEEK_END )); + const int iRet = static_cast(lseek( m_iFD, 0, SEEK_END )); ASSERT_M( iRet != -1, ssprintf("\"%s\": %s", m_sPath.c_str(), strerror(errno)) ); - _lseek( m_iFD, iOldPos, SEEK_SET ); + lseek( m_iFD, iOldPos, SEEK_SET ); return iRet; }