Changeset 337
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svnmerge-integrated changed
/branches/1.2 merged: 334
- Property svnmerge-integrated changed
-
trunk/mmap.c
r305 r337 176 176 if (strncmp(shm->name, "/dev", 4) == 0) { 177 177 perror(shm->name); 178 errstr = "Cannot open file set by xcache.mmap_path ";178 errstr = "Cannot open file set by xcache.mmap_path, check the xcache.size/var_size against system limitation"; 179 179 goto err; 180 180 } … … 183 183 if (fd == -1) { 184 184 perror(shm->name); 185 errstr = "Cannot open or create file set by xcache.mmap_path ";185 errstr = "Cannot open or create file set by xcache.mmap_path, check the path permission or check xcache.size/var_size against system limitation"; 186 186 goto err; 187 187 } -
trunk/xcache.c
r329 r337 1541 1541 xc_php_caches = NULL; 1542 1542 } 1543 xc_php_hcache.size = 0; 1544 1543 1545 if (xc_var_caches) { 1544 1546 shm = xc_cache_destroy(xc_var_caches, &xc_var_hcache); 1545 1547 xc_var_caches = NULL; 1546 1548 } 1549 xc_var_hcache.size = 0; 1550 fprintf(stderr, "set 0\n"); 1551 1547 1552 if (shm) { 1548 1553 xc_shm_destroy(shm); 1549 1554 } 1555 1556 xc_initized = 0; 1550 1557 } 1551 1558 /* }}} */ … … 1553 1560 { 1554 1561 xc_shm_t *shm; 1562 xc_shmsize_t shmsize = ALIGN(xc_php_size) + ALIGN(xc_var_size); 1555 1563 1556 1564 xc_php_caches = xc_var_caches = NULL; 1565 shm = NULL; 1566 1567 if (shmsize < (size_t) xc_php_size || shmsize < (size_t) xc_var_size) { 1568 zend_error(E_ERROR, "XCache: neither xcache.size nor xcache.var_size can be negative"); 1569 goto err; 1570 } 1557 1571 1558 1572 if (xc_php_size || xc_var_size) { 1559 CHECK(shm = xc_shm_init(xc_shm_scheme, ALIGN(xc_php_size) + ALIGN(xc_var_size), xc_readonly_protection, xc_mmap_path, NULL), "Cannot create shm");1573 CHECK(shm = xc_shm_init(xc_shm_scheme, shmsize, xc_readonly_protection, xc_mmap_path, NULL), "Cannot create shm"); 1560 1574 if (!shm->handlers->can_readonly(shm)) { 1561 1575 xc_readonly_protection = 0; … … 1573 1587 } 1574 1588 } 1575 return 1;1589 return SUCCESS; 1576 1590 1577 1591 err: 1592 xc_destroy(); 1578 1593 if (xc_php_caches || xc_var_caches) { 1579 xc_destroy(); 1580 /* shm destroied */ 1594 /* shm destroied in xc_destroy() */ 1581 1595 } 1582 1596 else if (shm) { … … 2678 2692 2679 2693 if ((xc_php_size || xc_var_size) && xc_mmap_path && xc_mmap_path[0]) { 2680 if ( !xc_init(module_number TSRMLS_CC)) {2694 if (xc_init(module_number TSRMLS_CC) != SUCCESS) { 2681 2695 zend_error(E_ERROR, "XCache: Cannot init"); 2682 2696 goto err_init; … … 2700 2714 if (xc_initized) { 2701 2715 xc_destroy(); 2702 xc_initized = 0;2703 2716 } 2704 2717 if (xc_mmap_path) {
Note: See TracChangeset
for help on using the changeset viewer.

