Changeset 334
- Timestamp:
- 2006-12-17T04:11:44+01:00 (6 years ago)
- Location:
- branches/1.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/mmap.c
r302 r334 184 184 if (strncmp(shm->name, "/dev", 4) == 0) { 185 185 perror(shm->name); 186 errstr = "Cannot open file set by xcache.mmap_path ";186 errstr = "Cannot open file set by xcache.mmap_path, check the xcache.size/var_size against system limitation"; 187 187 goto err; 188 188 } … … 191 191 if (fd == -1) { 192 192 perror(shm->name); 193 errstr = "Cannot open or create file set by xcache.mmap_path ";193 errstr = "Cannot open or create file set by xcache.mmap_path, check the path permission or check xcache.size/var_size against system limitation"; 194 194 goto err; 195 195 } -
branches/1.2/xcache.c
r328 r334 1372 1372 xc_php_caches = NULL; 1373 1373 } 1374 xc_php_hcache.size = 0; 1375 1374 1376 if (xc_var_caches) { 1375 1377 shm = xc_cache_destroy(xc_var_caches, &xc_var_hcache); 1376 1378 xc_var_caches = NULL; 1377 1379 } 1380 xc_var_hcache.size = 0; 1381 fprintf(stderr, "set 0\n"); 1382 1378 1383 if (shm) { 1379 1384 xc_shm_destroy(shm); 1380 1385 } 1386 1387 xc_initized = 0; 1381 1388 } 1382 1389 /* }}} */ … … 1384 1391 { 1385 1392 xc_shm_t *shm; 1393 xc_shmsize_t shmsize = ALIGN(xc_php_size) + ALIGN(xc_var_size); 1386 1394 1387 1395 xc_php_caches = xc_var_caches = NULL; 1396 shm = NULL; 1397 1398 if (shmsize < (size_t) xc_php_size || shmsize < (size_t) xc_var_size) { 1399 zend_error(E_ERROR, "XCache: neither xcache.size nor xcache.var_size can be negative"); 1400 goto err; 1401 } 1388 1402 1389 1403 if (xc_php_size || xc_var_size) { 1390 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");1404 CHECK(shm = xc_shm_init(xc_shm_scheme, shmsize, xc_readonly_protection, xc_mmap_path, NULL), "Cannot create shm"); 1391 1405 if (!shm->handlers->can_readonly(shm)) { 1392 1406 xc_readonly_protection = 0; … … 1404 1418 } 1405 1419 } 1406 return 1;1420 return SUCCESS; 1407 1421 1408 1422 err: 1423 xc_destroy(); 1409 1424 if (xc_php_caches || xc_var_caches) { 1410 xc_destroy(); 1411 /* shm destroied */ 1425 /* shm destroied in xc_destroy() */ 1412 1426 } 1413 1427 else if (shm) { … … 2521 2535 2522 2536 if ((xc_php_size || xc_var_size) && xc_mmap_path && xc_mmap_path[0]) { 2523 if ( !xc_init(module_number TSRMLS_CC)) {2537 if (xc_init(module_number TSRMLS_CC) != SUCCESS) { 2524 2538 zend_error(E_ERROR, "XCache: Cannot init"); 2525 2539 goto err_init; … … 2543 2557 if (xc_initized) { 2544 2558 xc_destroy(); 2545 xc_initized = 0;2546 2559 } 2547 2560 if (xc_mmap_path) {
Note: See TracChangeset
for help on using the changeset viewer.

