Index: xmlsitemap/xmlsitemap.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/xmlsitemap/xmlsitemap/Attic/xmlsitemap.pages.inc,v
retrieving revision 1.1.2.37
diff -u -p -r1.1.2.37 xmlsitemap.pages.inc
--- xmlsitemap/xmlsitemap.pages.inc	11 Jun 2009 13:14:58 -0000	1.1.2.37
+++ xmlsitemap/xmlsitemap.pages.inc	11 Jun 2009 13:38:11 -0000
@@ -105,7 +105,7 @@ function _xmlsitemap_check_cache_files()
   $parent_directory = variable_get('xmlsitemap_cache_directory', file_directory_path() .'/xmlsitemap');
   // If the directory that should contains the cache files doesn't exist, then
   // the cache files must be created.
-  if (!is_dir($parent_directory)) {
+  if (!file_check_directory($parent_directory, FILE_CREATE_DIRECTORY)) {
     return TRUE;
   }
   $update_timestamp = variable_get('xmlsitemap_update_timestamp', REQUEST_TIME);
@@ -218,14 +218,8 @@ function _xmlsitemap_create_cache_files(
   $id               = xmlsitemap_cache_id();
   $parent_directory = variable_get('xmlsitemap_cache_directory', file_directory_path() .'/xmlsitemap');
   // If the directory doesn't exist, then create it.
-  if (!is_dir($parent_directory)) {
-    if (@mkdir($parent_directory)) {
-      @chmod($parent_directory, 0775);
-    }
-    else {
-      watchdog('xmlsitemap', 'Could not create the cache files directory (@directory)', array('@directory' => $parent_directory), WATCHDOG_ERROR);
-      return FALSE;
-    }
+  if (!file_check_directory($parent_directory, FILE_CREATE_DIRECTORY)) {
+    return TRUE;
   }
   if ($link_count > $chunk_size) {
     if (!$fp = fopen($parent_directory ."/xsm-$id.xml", 'wb')) {
