Changeset 138

Show
Ignore:
Timestamp:
11/21/05 00:01:28 (3 years ago)
Author:
zoeloelip
Message:

check_cache_dir is only done when shm_only = 0
Only eA is disabled when init of shared mem or cache check fails

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r136 r138  
     12005-11-20 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
     2 
     3        * check_cache_dir is only done when shm_only = 0 
     4        * Only eA is disabled when init of shared mem or cache check fails 
     5 
    162005-11-20 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
    27 
  • eaccelerator/trunk/eaccelerator.c

    r134 r138  
    252252static int check_cache_dir(char *cache_dir) { 
    253253  struct stat buf; 
    254   int uid = 0; 
    255   int gid = 0; 
    256  
     254//  int uid = 0; 
     255//  int gid = 0; 
     256   
    257257  if (stat(cache_dir, &buf) == -1) { 
    258258    ea_debug_error("Cache dir does not exist (could not stat %s)\n", cache_dir); 
    259     return 0
     259    return FAILURE
    260260  } 
    261261  if (!(buf.st_mode & S_IFDIR)) { 
    262262    ea_debug_error("%s is not a directory!\n", cache_dir); 
    263     return 0
     263    return FAILURE
    264264  } 
    265265#if 0 
     
    273273  } 
    274274#endif 
    275   return 1
     275  return SUCCESS
    276276} 
    277277 
     
    327327  eaccelerator_mm_instance->last_prune = time(0); 
    328328  EACCELERATOR_PROTECT(); 
    329  
    330   if (!check_cache_dir(EAG(cache_dir))) { 
    331     return FAILURE; 
    332   } 
    333    
    334329  return SUCCESS; 
    335330} 
     
    20242019    if (init_mm(TSRMLS_C) == FAILURE) { 
    20252020      zend_error(E_CORE_WARNING,"[%s] Can not create shared memory area", EACCELERATOR_EXTENSION_NAME); 
    2026       return FAILURE; 
     2021      /* disable eA */ 
     2022      eaccelerator_mm_instance->enabled = 0; 
     2023    } 
     2024 
     2025    if (!eaccelerator_scripts_shm_only && check_cache_dir(EAG(cache_dir)) == FAILURE) { 
     2026      zend_error(E_CORE_WARNING,"[%s] Can not init the cache directory", EACCELERATOR_EXTENSION_NAME); 
     2027      /* disable eA */ 
     2028      eaccelerator_mm_instance->enabled = 0; 
    20272029    } 
    20282030