@@ -129,7 +129,7 @@ static ZEND_INI_MH((*orig_include_path_on_modify)) = NULL;
129
129
static zend_result (* orig_post_startup_cb )(void );
130
130
131
131
static zend_result accel_post_startup (void );
132
- static int accel_finish_startup (void );
132
+ static zend_result accel_finish_startup (void );
133
133
134
134
static void preload_shutdown (void );
135
135
static void preload_activate (void );
@@ -1165,7 +1165,7 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
1165
1165
return ret ;
1166
1166
}
1167
1167
1168
- int validate_timestamp_and_record (zend_persistent_script * persistent_script , zend_file_handle * file_handle )
1168
+ zend_result validate_timestamp_and_record (zend_persistent_script * persistent_script , zend_file_handle * file_handle )
1169
1169
{
1170
1170
if (persistent_script -> timestamp == 0 ) {
1171
1171
return SUCCESS ; /* Don't check timestamps of preloaded scripts */
@@ -1180,12 +1180,10 @@ int validate_timestamp_and_record(zend_persistent_script *persistent_script, zen
1180
1180
}
1181
1181
}
1182
1182
1183
- int validate_timestamp_and_record_ex (zend_persistent_script * persistent_script , zend_file_handle * file_handle )
1183
+ zend_result validate_timestamp_and_record_ex (zend_persistent_script * persistent_script , zend_file_handle * file_handle )
1184
1184
{
1185
- int ret ;
1186
-
1187
1185
SHM_UNPROTECT ();
1188
- ret = validate_timestamp_and_record (persistent_script , file_handle );
1186
+ const zend_result ret = validate_timestamp_and_record (persistent_script , file_handle );
1189
1187
SHM_PROTECT ();
1190
1188
1191
1189
return ret ;
@@ -1398,7 +1396,7 @@ static void zend_accel_lock_discard_script(zend_persistent_script *persistent_sc
1398
1396
zend_shared_alloc_unlock ();
1399
1397
}
1400
1398
1401
- int zend_accel_invalidate (zend_string * filename , bool force )
1399
+ zend_result zend_accel_invalidate (zend_string * filename , bool force )
1402
1400
{
1403
1401
zend_string * realpath ;
1404
1402
zend_persistent_script * persistent_script ;
@@ -2476,7 +2474,7 @@ static zend_class_entry* zend_accel_inheritance_cache_add(zend_class_entry *ce,
2476
2474
}
2477
2475
2478
2476
#ifdef ZEND_WIN32
2479
- static int accel_gen_uname_id (void )
2477
+ static zend_result accel_gen_uname_id (void )
2480
2478
{
2481
2479
PHP_MD5_CTX ctx ;
2482
2480
unsigned char digest [16 ];
@@ -2819,7 +2817,7 @@ static void zps_startup_failure(char *reason, char *api_reason, int (*cb)(zend_e
2819
2817
zend_llist_del_element (& zend_extensions , NULL , (int (* )(void * , void * ))cb );
2820
2818
}
2821
2819
2822
- static inline int accel_find_sapi (void )
2820
+ static inline zend_result accel_find_sapi (void )
2823
2821
{
2824
2822
static const char * supported_sapis [] = {
2825
2823
"apache" ,
@@ -2853,7 +2851,7 @@ static inline int accel_find_sapi(void)
2853
2851
return FAILURE ;
2854
2852
}
2855
2853
2856
- static int zend_accel_init_shm (void )
2854
+ static zend_result zend_accel_init_shm (void )
2857
2855
{
2858
2856
int i ;
2859
2857
size_t accel_shared_globals_size ;
@@ -3458,7 +3456,7 @@ static void accel_deactivate_now(void)
3458
3456
if OK returns SUCCESS
3459
3457
MUST call accelerator_shm_read_unlock after done lock operations
3460
3458
*/
3461
- int accelerator_shm_read_lock (void )
3459
+ zend_result accelerator_shm_read_lock (void )
3462
3460
{
3463
3461
if (ZCG (counted )) {
3464
3462
/* counted means we are holding read lock for SHM, so that nothing bad can happen */
@@ -4335,10 +4333,10 @@ static void preload_load(void)
4335
4333
}
4336
4334
}
4337
4335
4338
- static int accel_preload (const char * config , bool in_child )
4336
+ static zend_result accel_preload (const char * config , bool in_child )
4339
4337
{
4340
4338
zend_file_handle file_handle ;
4341
- int ret ;
4339
+ zend_result ret ;
4342
4340
char * orig_open_basedir ;
4343
4341
size_t orig_map_ptr_last ;
4344
4342
uint32_t orig_compiler_options ;
@@ -4585,10 +4583,9 @@ static void preload_send_header(sapi_header_struct *sapi_header, void *server_co
4585
4583
}
4586
4584
4587
4585
#ifndef ZEND_WIN32
4588
- static int accel_finish_startup_preload (bool in_child )
4586
+ static zend_result accel_finish_startup_preload (bool in_child )
4589
4587
{
4590
- int ret = SUCCESS ;
4591
- int rc ;
4588
+ zend_result ret = SUCCESS ;
4592
4589
int orig_error_reporting ;
4593
4590
4594
4591
int (* orig_activate )(void ) = sapi_module .activate ;
@@ -4623,7 +4620,7 @@ static int accel_finish_startup_preload(bool in_child)
4623
4620
orig_error_reporting = EG (error_reporting );
4624
4621
EG (error_reporting ) = 0 ;
4625
4622
4626
- rc = php_request_startup ();
4623
+ const zend_result rc = php_request_startup ();
4627
4624
4628
4625
EG (error_reporting ) = orig_error_reporting ;
4629
4626
@@ -4683,7 +4680,7 @@ static int accel_finish_startup_preload(bool in_child)
4683
4680
return ret ;
4684
4681
}
4685
4682
4686
- static int accel_finish_startup_preload_subprocess (pid_t * pid )
4683
+ static zend_result accel_finish_startup_preload_subprocess (pid_t * pid )
4687
4684
{
4688
4685
uid_t euid = geteuid ();
4689
4686
if (euid != 0 ) {
@@ -4750,7 +4747,7 @@ static int accel_finish_startup_preload_subprocess(pid_t *pid)
4750
4747
}
4751
4748
#endif /* ZEND_WIN32 */
4752
4749
4753
- static int accel_finish_startup (void )
4750
+ static zend_result accel_finish_startup (void )
4754
4751
{
4755
4752
if (!ZCG (enabled ) || !accel_startup_ok ) {
4756
4753
return SUCCESS ;
@@ -4791,7 +4788,7 @@ static int accel_finish_startup(void)
4791
4788
/* The called function unlocks the shared alloc lock */
4792
4789
return accel_finish_startup_preload (false);
4793
4790
} else if (pid == 0 ) { /* subprocess */
4794
- int ret = accel_finish_startup_preload (true);
4791
+ const zend_result ret = accel_finish_startup_preload (true);
4795
4792
4796
4793
exit (ret == SUCCESS ? 0 : 1 );
4797
4794
} else { /* parent */
0 commit comments