mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Add CFile::Sync()
This adds a simple wrapper for fsync() to CFileUtils. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1431 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -254,6 +254,14 @@ bool CFile::Truncate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CFile::Sync() {
|
||||
if (m_iFD != -1 && fsync(m_iFD) == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CFile::Open(const CString& sFileName, int iFlags, mode_t iMode) {
|
||||
SetFileName(sFileName);
|
||||
return Open(iFlags, iMode);
|
||||
|
||||
Reference in New Issue
Block a user