From: divverent Date: Sat, 7 Feb 2015 21:14:52 +0000 (+0000) Subject: Test return values of remove(). X-Git-Tag: xonotic-v0.8.1~29^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=507c7019ceeb58742c241b18cb5d0fba4d2cb0fb;p=xonotic%2Fdarkplaces.git Test return values of remove(). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12155 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/fs.c b/fs.c index 0941916b..f37fecd5 100644 --- a/fs.c +++ b/fs.c @@ -2715,7 +2715,15 @@ int FS_Close (qfile_t* file) if (file->filename) { if (file->flags & QFILE_FLAG_REMOVE) - remove(file->filename); + { + if (remove(file->filename) == -1) + { + // No need to report this. If removing a just + // written file failed, this most likely means + // someone else deleted it first - which we + // like. + } + } Mem_Free((void *) file->filename); }