unsigned socket_set_count = 0;
unsigned socket_set[FPM_ENV_SOCKET_SET_MAX];
unsigned socket_set_buf = 0;
- char envname[16];
+ char envname[32];
char *env_value = 0;
int p = 0;
struct listening_socket_s *ls = sockets_list.data;
}
if (env_value) {
- for(i = 0; i < socket_set_count; i++) {
- sprintf(envname, "FPM_SOCKETS_%d", i);
+ for (i = 0; i < socket_set_count; i++) {
+ if (!i) {
+ strcpy(envname, "FPM_SOCKETS");
+ } else {
+ sprintf(envname, "FPM_SOCKETS_%d", i);
+ }
setenv(envname, env_value + socket_set[i], 1);
}
free(env_value);
{
unsigned i, lq_len;
struct fpm_worker_pool_s *wp;
- char sockname[16];
+ char sockname[32];
char *inherited;
struct listening_socket_s *ls;
/* import inherited sockets */
for (i = 0; i < FPM_ENV_SOCKET_SET_MAX; i++) {
- sprintf(sockname, "FPM_SOCKETS_%d", i);
+ if (!i) {
+ strcpy(sockname, "FPM_SOCKETS");
+ } else {
+ sprintf(sockname, "FPM_SOCKETS_%d", i);
+ }
inherited = getenv(sockname);
if (!inherited) break;