Skip to content

Commit 91e70a4

Browse files
committed
Merge branch 'PHP-8.2'
2 parents e114f32 + 8a221e2 commit 91e70a4

File tree

3 files changed

+28
-62
lines changed

3 files changed

+28
-62
lines changed

sapi/litespeed/lsapi_main.c

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,9 @@ static void log_message (const char *fmt, ...)
537537
#define DEBUG_MESSAGE(fmt, ...)
538538
#endif
539539

540-
static int lsapi_activate_user_ini();
540+
static int lsapi_activate_user_ini(void);
541541

542-
static int sapi_lsapi_activate()
542+
static int sapi_lsapi_activate(void)
543543
{
544544
char *path, *server_name;
545545
size_t path_len, server_name_len;
@@ -677,10 +677,9 @@ static int do_clean_shutdown = 1;
677677
static int clean_onexit = 1;
678678

679679

680-
static void lsapi_clean_shutdown()
680+
static void lsapi_clean_shutdown(void)
681681
{
682682
struct sigaction act;
683-
int sa_rc;
684683
struct itimerval tmv;
685684
#if PHP_MAJOR_VERSION >= 7
686685
zend_string * key;
@@ -689,15 +688,14 @@ static void lsapi_clean_shutdown()
689688
sigemptyset(&act.sa_mask);
690689
act.sa_flags = 0;
691690
act.sa_handler = lsapi_sigsegv;
692-
sa_rc = sigaction(SIGINT, &act, NULL);
693-
sa_rc = sigaction(SIGQUIT, &act, NULL);
694-
sa_rc = sigaction(SIGILL, &act, NULL);
695-
sa_rc = sigaction(SIGABRT, &act, NULL);
696-
sa_rc = sigaction(SIGBUS, &act, NULL);
697-
sa_rc = sigaction(SIGSEGV, &act, NULL);
698-
sa_rc = sigaction(SIGTERM, &act, NULL);
699-
700-
sa_rc = sigaction(SIGPROF, &act, NULL);
691+
(void)sigaction(SIGINT, &act, NULL);
692+
(void)sigaction(SIGQUIT, &act, NULL);
693+
(void)sigaction(SIGILL, &act, NULL);
694+
(void)sigaction(SIGABRT, &act, NULL);
695+
(void)sigaction(SIGBUS, &act, NULL);
696+
(void)sigaction(SIGSEGV, &act, NULL);
697+
(void)sigaction(SIGTERM, &act, NULL);
698+
(void)sigaction(SIGPROF, &act, NULL);
701699
memset(&tmv, 0, sizeof(struct itimerval));
702700
tmv.it_value.tv_sec = 0;
703701
tmv.it_value.tv_usec = 100000;
@@ -738,11 +736,9 @@ static void lsapi_atexit(void)
738736
}
739737
}
740738

741-
742739
static int lsapi_module_main(int show_source)
743740
{
744741
struct sigaction act;
745-
int sa_rc;
746742
if (php_request_startup() == FAILURE ) {
747743
return -1;
748744
}
@@ -751,13 +747,13 @@ static int lsapi_module_main(int show_source)
751747
sigemptyset(&act.sa_mask);
752748
act.sa_flags = SA_NODEFER;
753749
act.sa_handler = lsapi_sigterm;
754-
sa_rc = sigaction( SIGINT, &act, NULL);
755-
sa_rc = sigaction( SIGQUIT, &act, NULL);
756-
sa_rc = sigaction( SIGILL, &act, NULL);
757-
sa_rc = sigaction( SIGABRT, &act, NULL);
758-
sa_rc = sigaction( SIGBUS, &act, NULL);
759-
sa_rc = sigaction( SIGSEGV, &act, NULL);
760-
sa_rc = sigaction( SIGTERM, &act, NULL);
750+
(void)sigaction( SIGINT, &act, NULL);
751+
(void)sigaction( SIGQUIT, &act, NULL);
752+
(void)sigaction( SIGILL, &act, NULL);
753+
(void)sigaction( SIGABRT, &act, NULL);
754+
(void)sigaction( SIGBUS, &act, NULL);
755+
(void)sigaction( SIGSEGV, &act, NULL);
756+
(void)sigaction( SIGTERM, &act, NULL);
761757

762758
clean_onexit = 0;
763759
}
@@ -834,7 +830,7 @@ static void user_config_cache_entry_dtor(zval *el)
834830
free(entry);
835831
}
836832

837-
static void user_config_cache_init()
833+
static void user_config_cache_init(void)
838834
{
839835
zend_hash_init(&user_config_cache, 0, NULL, user_config_cache_entry_dtor, 1);
840836
}
@@ -1101,7 +1097,7 @@ static int lsapi_activate_user_ini( void )
11011097
}
11021098

11031099

1104-
static void override_ini()
1100+
static void override_ini(void)
11051101
{
11061102

11071103
LSAPI_ForeachSpecialEnv( alter_ini, NULL );

sapi/litespeed/lsapilib.c

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@ static int LSAPI_perror_r( LSAPI_Request * pReq, const char * pErr1, const char
922922
}
923923

924924

925+
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
925926
static int lsapi_lve_error( LSAPI_Request * pReq )
926927
{
927928
static const char * headers[] =
@@ -945,10 +946,8 @@ static int lsapi_lve_error( LSAPI_Request * pReq )
945946
return 0;
946947
}
947948

948-
949949
static int lsapi_enterLVE( LSAPI_Request * pReq, uid_t uid )
950950
{
951-
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
952951
if ( s_lve && uid ) //root user should not do that
953952
{
954953
uint32_t cookie;
@@ -962,16 +961,13 @@ static int lsapi_enterLVE( LSAPI_Request * pReq, uid_t uid )
962961
return -1;
963962
}
964963
}
965-
#endif
966964

967965
return 0;
968966
}
969967

970-
971968
static int lsapi_jailLVE( LSAPI_Request * pReq, uid_t uid, struct passwd * pw )
972969
{
973970
int ret = 0;
974-
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
975971
char error_msg[1024] = "";
976972
ret = (*fp_lve_jail)( pw, error_msg );
977973
if ( ret < 0 )
@@ -981,12 +977,10 @@ static int lsapi_jailLVE( LSAPI_Request * pReq, uid_t uid, struct passwd * pw )
981977
LSAPI_perror_r( pReq, "LSAPI: jail() failure.", NULL );
982978
return -1;
983979
}
984-
#endif
985980
return ret;
986981
}
987982

988983

989-
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
990984
static int lsapi_initLVE(void)
991985
{
992986
const char * pEnv;
@@ -1366,30 +1360,6 @@ static inline int lsapi_notify_pid( int fd )
13661360
return 0;
13671361
}
13681362

1369-
1370-
static char s_conn_key_packet[16];
1371-
static inline int init_conn_key( int fd )
1372-
{
1373-
struct lsapi_packet_header * pHeader = (struct lsapi_packet_header *)s_conn_key_packet;
1374-
struct timeval tv;
1375-
int i;
1376-
gettimeofday( &tv, NULL );
1377-
srand( (tv.tv_sec % 0x1000 + tv.tv_usec) ^ rand() );
1378-
for( i = 8; i < 16; ++i )
1379-
{
1380-
s_conn_key_packet[i]=(int) (256.0*rand()/(RAND_MAX+1.0));
1381-
}
1382-
lsapi_buildPacketHeader( pHeader, LSAPI_REQ_RECEIVED,
1383-
8 + LSAPI_PACKET_HEADER_LEN );
1384-
if ( write( fd, s_conn_key_packet, LSAPI_PACKET_HEADER_LEN+8 )
1385-
< LSAPI_PACKET_HEADER_LEN+8 )
1386-
return -1;
1387-
return 0;
1388-
1389-
1390-
}
1391-
1392-
13931363
static int readReq( LSAPI_Request * pReq )
13941364
{
13951365
int len;
@@ -3160,11 +3130,11 @@ static void lsapi_check_child_status( long tmCur )
31603130
//}
31613131

31623132

3163-
void set_skip_write()
3133+
void set_skip_write(void)
31643134
{ s_skip_write = 1; }
31653135

31663136

3167-
int is_enough_free_mem()
3137+
int is_enough_free_mem(void)
31683138
{
31693139
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
31703140
//minimum 1GB or 10% available free memory
@@ -3832,7 +3802,7 @@ void LSAPI_No_Check_ppid(void)
38323802
}
38333803

38343804

3835-
int LSAPI_Get_ppid()
3805+
int LSAPI_Get_ppid(void)
38363806
{
38373807
return(s_ppid);
38383808
}

sapi/litespeed/lscriu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9595
static int s_initial_start_reqs = 0;
9696
static int s_requests_count = 0;
9797
static int s_restored = 0;
98-
static int (*s_lscapi_dump_me)() = NULL;
99-
static int (*s_lscapi_prepare_me)() = NULL;
98+
static int (*s_lscapi_dump_me)(void) = NULL;
99+
static int (*s_lscapi_prepare_me)(void) = NULL;
100100
static int s_native = 0;
101101
static int s_tried_checkpoint = 0;
102102
static int s_criu_debug = 0;
@@ -118,7 +118,7 @@ typedef void (*sighandler_t)(int);
118118

119119
void lsapi_perror( const char * pMessage, int err_no );
120120
void LSAPI_reset_server_state( void );
121-
int LSAPI_Get_ppid();
121+
int LSAPI_Get_ppid(void);
122122

123123
#ifdef LSAPILIB_DEBUG_CRIU
124124
#define lscriu_dbg(...) \
@@ -541,7 +541,7 @@ static void LSCRIU_try_checkpoint(int *forked_pid)
541541
}
542542

543543

544-
static int init_native_env()
544+
static int init_native_env(void)
545545
{
546546
char *pchFd;
547547
pchFd = getenv("LSAPI_CRIU_SYNC_FD");

0 commit comments

Comments
 (0)