Skip to content

Commit ed1bb78

Browse files
committed
sapi/fpm: make several globals const
1 parent 9185c7d commit ed1bb78

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

sapi/fpm/fpm/fpm_conf.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static char *ini_include = NULL;
8484
/*
8585
* Please keep the same order as in fpm_conf.h and in php-fpm.conf.in
8686
*/
87-
static struct ini_value_parser_s ini_fpm_global_options[] = {
87+
static const struct ini_value_parser_s ini_fpm_global_options[] = {
8888
{ "pid", &fpm_conf_set_string, GO(pid_file) },
8989
{ "error_log", &fpm_conf_set_string, GO(error_log) },
9090
#ifdef HAVE_SYSLOG_H
@@ -112,7 +112,7 @@ static struct ini_value_parser_s ini_fpm_global_options[] = {
112112
/*
113113
* Please keep the same order as in fpm_conf.h and in php-fpm.conf.in
114114
*/
115-
static struct ini_value_parser_s ini_fpm_pool_options[] = {
115+
static const struct ini_value_parser_s ini_fpm_pool_options[] = {
116116
{ "prefix", &fpm_conf_set_string, WPO(prefix) },
117117
{ "user", &fpm_conf_set_string, WPO(user) },
118118
{ "group", &fpm_conf_set_string, WPO(group) },
@@ -1183,11 +1183,10 @@ static int fpm_conf_process_all_pools(void)
11831183
/* env[], php_value[], php_admin_values[] */
11841184
if (!wp->config->chroot) {
11851185
struct key_value_s *kv;
1186-
char *options[] = FPM_PHP_INI_TO_EXPAND;
1187-
char **p;
1186+
static const char *const options[] = FPM_PHP_INI_TO_EXPAND;
11881187

11891188
for (kv = wp->config->php_values; kv; kv = kv->next) {
1190-
for (p = options; *p; p++) {
1189+
for (const char *const*p = options; *p; p++) {
11911190
if (!strcasecmp(kv->key, *p)) {
11921191
fpm_evaluate_full_path(&kv->value, wp, NULL, 0);
11931192
}
@@ -1197,7 +1196,7 @@ static int fpm_conf_process_all_pools(void)
11971196
if (!strcasecmp(kv->key, "error_log") && !strcasecmp(kv->value, "syslog")) {
11981197
continue;
11991198
}
1200-
for (p = options; *p; p++) {
1199+
for (const char *const*p = options; *p; p++) {
12011200
if (!strcasecmp(kv->key, *p)) {
12021201
fpm_evaluate_full_path(&kv->value, wp, NULL, 0);
12031202
}
@@ -1464,7 +1463,7 @@ static void fpm_conf_ini_parser_section(zval *section, void *arg) /* {{{ */
14641463

14651464
static void fpm_conf_ini_parser_entry(zval *name, zval *value, void *arg) /* {{{ */
14661465
{
1467-
struct ini_value_parser_s *parser;
1466+
const struct ini_value_parser_s *parser;
14681467
void *config = NULL;
14691468

14701469
int *error = (int *)arg;

sapi/fpm/fpm/fpm_signals.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ int fpm_signals_init_mask(void)
267267
/* Subset of signals from fpm_signals_init_main() and fpm_got_signal()
268268
blocked to avoid unexpected death during early init
269269
or during reload just after execvp() or fork */
270-
int init_signal_array[] = { SIGUSR1, SIGUSR2, SIGCHLD };
270+
static const int init_signal_array[] = { SIGUSR1, SIGUSR2, SIGCHLD };
271271
size_t size = sizeof(init_signal_array)/sizeof(init_signal_array[0]);
272272
size_t i = 0;
273273
if (0 > sigemptyset(&block_sigset) ||

0 commit comments

Comments
 (0)