From: <ps...@us...> - 2008-12-31 14:35:01
|
Revision: 1316 http://znc.svn.sourceforge.net/znc/?rev=1316&view=rev Author: psychon Date: 2008-12-31 14:34:55 +0000 (Wed, 31 Dec 2008) Log Message: ----------- Use fchmod() instead of chmod() if the file is already open Modified Paths: -------------- trunk/FileUtils.cpp Modified: trunk/FileUtils.cpp =================================================================== --- trunk/FileUtils.cpp 2008-12-31 13:49:29 UTC (rev 1315) +++ trunk/FileUtils.cpp 2008-12-31 14:34:55 UTC (rev 1316) @@ -223,7 +223,10 @@ } 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) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |