CFile::Close(): check return value of close() for errors

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1476 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-04-04 11:49:15 +00:00
parent 36707be076
commit 22b219dbe0

View File

@@ -372,7 +372,10 @@ int CFile::Write(const CString & sData) {
}
void CFile::Close() {
if (m_iFD >= 0) {
close(m_iFD);
if (close(m_iFD) < 0) {
DEBUG("CFile::Close(): close() failed with ["
<< strerror(errno) << "]");
}
}
m_iFD = -1;
ClearBuffer();