Delete the cache in tmp even if the copy failed. Props andy. fixes #4141

git-svn-id: http://svn.automattic.com/wordpress/trunk@5255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-04-12 16:31:47 +00:00
parent 570b2a4600
commit 75efedc528
1 changed files with 2 additions and 3 deletions

View File

@ -340,10 +340,9 @@ class WP_Object_Cache {
fputs($fd, $serial); fputs($fd, $serial);
fclose($fd); fclose($fd);
if (!@ rename($temp_file, $cache_file)) { if (!@ rename($temp_file, $cache_file)) {
if (@ copy($temp_file, $cache_file)) if (!@ copy($temp_file, $cache_file))
@ unlink($temp_file);
else
$errors++; $errors++;
@ unlink($temp_file);
} }
@ chmod($cache_file, $file_perms); @ chmod($cache_file, $file_perms);
} }