Fix CLockFile's fd leak

CLockFile::Close() only closed the fd if we didn't call
fork() or are the father. Fix this.

This also fixes rehashing for --disable-debug.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@955 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-02-11 21:01:50 +00:00
parent 8581b34778
commit 74623a9e5c
+5 -2
View File
@@ -85,15 +85,18 @@ public:
void Close() {
if (getpid() == m_pid && m_fd > -1) {
// This UnLock() also unlocks for all of our childs!
UnLock();
close(m_fd);
if (m_bCreated) {
unlink(m_sFileName.c_str());
}
} else if (m_fd > -1)
// Make sure we don't leak this fd
close(m_fd);
Init();
}
Init();
}
void Open(const CString& sFile, bool bRw = false) {