]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Test return values of remove().
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 7 Feb 2015 21:14:52 +0000 (21:14 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 7 Feb 2015 21:14:52 +0000 (21:14 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12155 d7cf8633-e32d-0410-b094-e92efae38249

fs.c

diff --git a/fs.c b/fs.c
index 0941916ba64471a6ea92b873533e7b2117e7c75a..f37fecd505de69f1ef57fd25d5b61449f8a6369a 100644 (file)
--- 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);
        }