Write files in such a way that a program crash, system crash, powerdown,

etc. won't cause data loss if we're running on a journalling filesystem.
This commit is contained in:
Glenn Maynard
2003-12-21 07:23:29 +00:00
parent 50f5ddc5ea
commit 20792a51bb
10 changed files with 178 additions and 38 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ class RageFileDriverMountpoints: public RageFileDriver
{
public:
RageFileDriverMountpoints(): RageFileDriver( new FilenameDB ) { }
RageFileObj *Open( const CString &path, RageFile::OpenMode mode, RageFile &p, int &err )
RageFileObj *Open( const CString &path, int mode, RageFile &p, int &err )
{
err = (mode == RageFile::WRITE)? EINVAL:ENOENT;
return NULL;
@@ -343,7 +343,7 @@ void RemoveReference( const RageFileObj *obj )
}
/* Used only by RageFile: */
RageFileObj *RageFileManager::Open( const CString &sPath, RageFile::OpenMode mode, RageFile &p, int &err )
RageFileObj *RageFileManager::Open( const CString &sPath, int mode, RageFile &p, int &err )
{
err = ENOENT;
@@ -389,7 +389,7 @@ RageFileObj *RageFileManager::CopyFileObj( const RageFileObj *cpy, RageFile &p )
return ret;
}
RageFileObj *RageFileManager::OpenForWriting( const CString &sPath, RageFile::OpenMode mode, RageFile &p, int &err )
RageFileObj *RageFileManager::OpenForWriting( const CString &sPath, int mode, RageFile &p, int &err )
{
/*
* The value for a driver to open a file is the number of directories and/or files