Suppress fopen warnings and check return.

git-svn-id: http://svn.automattic.com/wordpress/trunk@3170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-11-19 20:12:26 +00:00
parent 51b8a36906
commit 6628bfcf35
1 changed files with 3 additions and 1 deletions

View File

@ -302,7 +302,9 @@ class WP_Object_Cache {
$temp_file = tempnam($group_dir, 'tmp');
$serial = CACHE_SERIAL_HEADER.serialize($this->cache[$group][$id]).CACHE_SERIAL_FOOTER;
$fd = fopen($temp_file, 'w');
$fd = @fopen($temp_file, 'w');
if ( false === $fd )
continue;
fputs($fd, $serial);
fclose($fd);
if (!@ rename($temp_file, $cache_file)) {