diff --git a/znc.cpp b/znc.cpp index 2414856a..59c3ed04 100644 --- a/znc.cpp +++ b/znc.cpp @@ -137,8 +137,8 @@ bool CZNC::ConnectUser(CUser *pUser) { return false; if (!WriteISpoof(pUser)) { - DEBUG("ISpoof could not be written"); - pUser->PutStatus("ISpoof could not be written, retrying..."); + DEBUG("ISpoof [" + m_sISpoofFile + "] could not be written"); + pUser->PutStatus("ISpoof [" + m_sISpoofFile + "] could not be written, retrying..."); return true; } @@ -258,6 +258,7 @@ bool CZNC::WriteISpoof(CUser* pUser) { if (!m_sISpoofFile.empty()) { m_pISpoofLockFile = new CFile; if (!m_pISpoofLockFile->TryExLock(m_sISpoofFile, O_RDWR | O_CREAT)) { + DEBUG("Couldn't open and lock ISpoofFile: " << strerror(errno)); delete m_pISpoofLockFile; m_pISpoofLockFile = NULL; return false; @@ -269,6 +270,7 @@ bool CZNC::WriteISpoof(CUser* pUser) { m_sOrigISpoof = buf; if (!m_pISpoofLockFile->Seek(0) || !m_pISpoofLockFile->Truncate()) { + DEBUG("Couldn't truncate the ISpoofFile: " << strerror(errno)); delete m_pISpoofLockFile; m_pISpoofLockFile = NULL; return false; @@ -281,6 +283,7 @@ bool CZNC::WriteISpoof(CUser* pUser) { if (sData == m_sISpoofFormat) { sData.Replace("%", pUser->GetIdent()); } + DEBUG("Writing [" + sData + "] to ISpoofFile [" + m_sISpoofFile + "]"); m_pISpoofLockFile->Write(sData + "\n"); } return true; @@ -292,7 +295,10 @@ void CZNC::ReleaseISpoof() { if (!m_sISpoofFile.empty()) { if (m_pISpoofLockFile->Seek(0) && m_pISpoofLockFile->Truncate()) { + DEBUG("Writing [" + m_sOrigISpoof + "] to ISpoofFile [" + m_sISpoofFile + "]"); m_pISpoofLockFile->Write(m_sOrigISpoof); + } else { + DEBUG("Error while restoring ISpoof: " << strerror(errno)); } m_sOrigISpoof = "";