Use fchmod() instead of chmod() if the file is already open

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1316 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-12-31 14:34:55 +00:00
parent 3538290068
commit 69279c516e
+4 -1
View File
@@ -223,7 +223,10 @@ bool CFile::Copy(const CString& sOldFileName, const CString& sNewFileName, bool
}
bool CFile::Chmod(mode_t mode) {
return CFile::Chmod(m_sLongName, mode);
if (m_iFD == -1) {
return false;
}
return (fchmod(m_iFD, mode) == 0);
}
bool CFile::Chmod(const CString& sFile, mode_t mode) {