From 22b219dbe0486cf0064d13c3ff19aa9f286a4033 Mon Sep 17 00:00:00 2001 From: psychon Date: Sat, 4 Apr 2009 11:49:15 +0000 Subject: [PATCH] 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 --- FileUtils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FileUtils.cpp b/FileUtils.cpp index 0db8961f..c436b81a 100644 --- a/FileUtils.cpp +++ b/FileUtils.cpp @@ -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();