]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
command line option -readonly to turn off all writing
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 18 Sep 2012 11:57:22 +0000 (11:57 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 18 Sep 2012 11:57:22 +0000 (11:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11845 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index e21a58395b99b6c775903f96bdda2ce20e5f8234..6e45cd81ac4cb5704cad7af857b63bd7176a6ae0 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -2155,6 +2155,9 @@ int FS_SysOpenFD(const char *filepath, const char *mode, qboolean nonblocking)
        if (nonblocking)
                opt |= O_NONBLOCK;
 
+       if(COM_CheckParm("-readonly") && mod != O_RDONLY)
+               return -1;
+
 #ifdef WIN32
 # if _MSC_VER >= 1400
        _sopen_s(&handle, filepath, mod | opt, (dolock ? ((mod == O_RDONLY) ? _SH_DENYRD : _SH_DENYRW) : _SH_DENYNO), _S_IREAD | _S_IWRITE);
@@ -3372,6 +3375,9 @@ qboolean FS_SysFileExists (const char *path)
 
 void FS_mkdir (const char *path)
 {
+       if(COM_CheckParm("-readonly"))
+               return;
+
 #if WIN32
        _mkdir (path);
 #else