mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user