diff --git a/DCCSock.cpp b/DCCSock.cpp index ae0e5a1c..4f39ee1f 100644 --- a/DCCSock.cpp +++ b/DCCSock.cpp @@ -164,7 +164,7 @@ CFile* CDCCSock::OpenFile(bool bWrite) { return NULL; } - if (!m_pFile->Open(O_RDONLY)) { + if (!m_pFile->Open()) { delete m_pFile; m_pFile = NULL; m_pUser->PutModule(m_sModuleName, "DCC -> [" + m_sRemoteNick + "] - Could not open file [" + m_sLocalFile + "]"); diff --git a/FileUtils.cpp b/FileUtils.cpp index 074265e7..f628cfb2 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -189,7 +189,7 @@ bool CFile::Copy(const CString& sOldFileName, const CString& sNewFileName, bool CFile OldFile(sOldFileName); CFile NewFile(sNewFileName); - if (!OldFile.Open(O_RDONLY)) { + if (!OldFile.Open()) { return false; } diff --git a/FileUtils.h b/FileUtils.h index 9192fde5..386f8dc2 100644 --- a/FileUtils.h +++ b/FileUtils.h @@ -106,8 +106,8 @@ public: static bool Chmod(const CString& sFile, mode_t mode); bool Seek(unsigned long uPos); bool Truncate(); - bool Open(const CString& sFileName, int iFlags, mode_t iMode = 0644); - bool Open(int iFlags, mode_t iMode = 0644); + bool Open(const CString& sFileName, int iFlags = O_RDONLY, mode_t iMode = 0644); + bool Open(int iFlags = O_RDONLY, mode_t iMode = 0644); int Read(char *pszBuffer, int iBytes); bool ReadLine(CString & sData, const CString & sDelimiter = "\n"); bool ReadFile(CString& sData, size_t iMaxSize = 512 * 1024); diff --git a/Template.cpp b/Template.cpp index 6c992ff6..28ab16d0 100644 --- a/Template.cpp +++ b/Template.cpp @@ -138,7 +138,7 @@ bool CTemplate::Print(const CString& sFileName, ostream& oOut) { CFile File(sFileName); - if (!File.Open(O_RDONLY)) { + if (!File.Open()) { DEBUG_ONLY(cerr << "Unable to open file [" << sFileName << "] in CTemplate::Print()" << endl); return false; } diff --git a/modules/away.cpp b/modules/away.cpp index 28666f11..b7996091 100644 --- a/modules/away.cpp +++ b/modules/away.cpp @@ -387,7 +387,7 @@ private: CFile File(sMessages); - if (sMessages.empty() || !File.Open(O_RDONLY) || !File.ReadFile(sFile)) + if (sMessages.empty() || !File.Open() || !File.ReadFile(sFile)) { PutModule("Unable to find buffer"); return(true); // gonna be successful here diff --git a/modules/modperl.cpp b/modules/modperl.cpp index ac0a69d0..c595b413 100644 --- a/modules/modperl.cpp +++ b/modules/modperl.cpp @@ -247,7 +247,7 @@ public: CString sBuffer, sScript; CFile cFile(sModule); - if (!cFile.Exists() || !cFile.Open(O_RDONLY)) + if (!cFile.Exists() || !cFile.Open()) return false; while (cFile.ReadLine(sBuffer)) diff --git a/modules/savebuff.cpp b/modules/savebuff.cpp index 9ff6a36e..c172d937 100644 --- a/modules/savebuff.cpp +++ b/modules/savebuff.cpp @@ -304,7 +304,7 @@ private: CFile File(sChannel); - if (sChannel.empty() || !File.Open(O_RDONLY) || !File.ReadFile(sFile)) + if (sChannel.empty() || !File.Open() || !File.ReadFile(sFile)) return(true); // gonna be successful here File.Close();