From: divverent Date: Tue, 18 Sep 2012 11:57:22 +0000 (+0000) Subject: command line option -readonly to turn off all writing X-Git-Tag: xonotic-v0.7.0~107 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ff4a8e4087650009419a7c056cc8eee050fdaaaa;p=xonotic%2Fdarkplaces.git command line option -readonly to turn off all writing git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11845 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=2ed9f7d0739f091727dea48ba46a65b103802bd9 --- diff --git a/fs.c b/fs.c index e21a5839..6e45cd81 100644 --- 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