From 507c7019ceeb58742c241b18cb5d0fba4d2cb0fb Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 7 Feb 2015 21:14:52 +0000 Subject: [PATCH] Test return values of remove(). git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12155 d7cf8633-e32d-0410-b094-e92efae38249 --- fs.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); } -- 2.39.2