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:
psychon
2009-03-18 15:40:05 +00:00
parent 32ffc2b3d5
commit f618ce2a8d
2 changed files with 9 additions and 0 deletions

View File

@@ -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);