@@ -2411,14 +2411,14 @@ static inline int accel_find_sapi(TSRMLS_D)
2411
2411
return FAILURE ;
2412
2412
}
2413
2413
2414
- static void zend_accel_init_shm (TSRMLS_D )
2414
+ static int zend_accel_init_shm (TSRMLS_D )
2415
2415
{
2416
2416
zend_shared_alloc_lock (TSRMLS_C );
2417
2417
2418
2418
accel_shared_globals = zend_shared_alloc (sizeof (zend_accel_shared_globals ));
2419
2419
if (!accel_shared_globals ) {
2420
2420
zend_accel_error (ACCEL_LOG_FATAL , "Insufficient shared memory!" );
2421
- return ;
2421
+ return FAILURE ;
2422
2422
}
2423
2423
ZSMMG (app_shared_globals ) = accel_shared_globals ;
2424
2424
@@ -2433,7 +2433,8 @@ static void zend_accel_init_shm(TSRMLS_D)
2433
2433
ZCSG (interned_strings ).arBuckets = zend_shared_alloc (ZCSG (interned_strings ).nTableSize * sizeof (Bucket * ));
2434
2434
ZCSG (interned_strings_start ) = zend_shared_alloc ((ZCG (accel_directives ).interned_strings_buffer * 1024 * 1024 ));
2435
2435
if (!ZCSG (interned_strings ).arBuckets || !ZCSG (interned_strings_start )) {
2436
- zend_error (E_ERROR , ACCELERATOR_PRODUCT_NAME " cannot allocate buffer for interned strings" );
2436
+ zend_accel_error (ACCEL_LOG_FATAL , ACCELERATOR_PRODUCT_NAME " cannot allocate buffer for interned strings" );
2437
+ return FAILURE ;
2437
2438
}
2438
2439
ZCSG (interned_strings_end ) = ZCSG (interned_strings_start ) + (ZCG (accel_directives ).interned_strings_buffer * 1024 * 1024 );
2439
2440
ZCSG (interned_strings_top ) = ZCSG (interned_strings_start );
@@ -2472,6 +2473,8 @@ static void zend_accel_init_shm(TSRMLS_D)
2472
2473
ZCSG (restart_in_progress ) = 0 ;
2473
2474
2474
2475
zend_shared_alloc_unlock (TSRMLS_C );
2476
+
2477
+ return SUCCESS ;
2475
2478
}
2476
2479
2477
2480
static void accel_globals_ctor (zend_accel_globals * accel_globals TSRMLS_DC )
@@ -2529,7 +2532,10 @@ static int accel_startup(zend_extension *extension)
2529
2532
/********************************************/
2530
2533
switch (zend_shared_alloc_startup (ZCG (accel_directives ).memory_consumption )) {
2531
2534
case ALLOC_SUCCESS :
2532
- zend_accel_init_shm (TSRMLS_C );
2535
+ if (zend_accel_init_shm (TSRMLS_C ) == FAILURE ) {
2536
+ accel_startup_ok = 0 ;
2537
+ return FAILURE ;
2538
+ }
2533
2539
break ;
2534
2540
case ALLOC_FAILURE :
2535
2541
accel_startup_ok = 0 ;
0 commit comments