Legend:
- Unmodified
- Added
- Removed
-
trunk/mmap.c
r11 r21 138 138 xc_shm_t *xc_shm_init(const char *path, xc_shmsize_t size, zend_bool readonly_protection) /* {{{ */ 139 139 { 140 #ifdef ZEND_WIN32 141 # define TMP_PATH "XCache" 142 #else 143 # define TMP_PATH "/tmp/XCache" 144 #endif 140 145 xc_shm_t *shm = NULL; 141 146 int fd = -1; 142 147 int ro_ok; 143 148 volatile void *romem; 144 char tmpname[sizeof( "/tmp/xcache") - 1 + 100];149 char tmpname[sizeof(TMP_PATH) - 1 + 100]; 145 150 146 151 CHECK(shm = calloc(1, sizeof(xc_shm_t)), "shm OOM"); … … 149 154 if (path == NULL || !path[0]) { 150 155 static int inc = 0; 151 snprintf(tmpname, sizeof(tmpname) - 1, " /tmp/xcache.%d.%d.%d", (int) getuid(), inc ++, rand());156 snprintf(tmpname, sizeof(tmpname) - 1, "%s.%d.%d.%d", TMP_PATH, (int) getuid(), inc ++, rand()); 152 157 path = tmpname; 153 158 } -
trunk/xcache.c
r20 r21 1712 1712 #endif 1713 1713 1714 #ifdef ZEND_WIN32 1715 # define DEFAULT_PATH "xcache" 1716 #else 1717 # define DEFAULT_PATH "/dev/zero" 1718 #endif 1714 1719 PHP_INI_BEGIN() 1715 1720 PHP_INI_ENTRY1 ("xcache.size", "0", PHP_INI_SYSTEM, xc_OnUpdateLong, &xc_php_size) … … 1721 1726 PHP_INI_ENTRY1 ("xcache.var_slots", "8K", PHP_INI_SYSTEM, xc_OnUpdateHashInfo, &xc_var_hentry) 1722 1727 1723 PHP_INI_ENTRY1 ("xcache.mmap_path", "/dev/zero", PHP_INI_SYSTEM, xc_OnUpdateString, &xc_mmap_path)1728 PHP_INI_ENTRY1 ("xcache.mmap_path", DEFAULT_PATH, PHP_INI_SYSTEM, xc_OnUpdateString, &xc_mmap_path) 1724 1729 PHP_INI_ENTRY1 ("xcache.coredump_directory", "", PHP_INI_SYSTEM, xc_OnUpdateString, &xc_coredump_dir) 1725 1730 PHP_INI_ENTRY1 ("xcache.test", "0", PHP_INI_SYSTEM, xc_OnUpdateBool, &xc_test) … … 1821 1826 if ((xc_php_size || xc_var_size) && xc_mmap_path && xc_mmap_path[0]) { 1822 1827 if (!xc_init(module_number TSRMLS_CC)) { 1823 zend_error(E_ERROR, "XCache: Cannot init xcache");1828 zend_error(E_ERROR, "XCache: Cannot init"); 1824 1829 goto err_init; 1825 1830 } … … 1892 1897 zend_module_entry xcache_module_entry = { 1893 1898 STANDARD_MODULE_HEADER, 1894 " xcache",1899 "XCache", 1895 1900 xcache_functions, 1896 1901 PHP_MINIT(xcache),

