diff options
author | Igor Sysoev <igor@sysoev.ru> | 2007-06-15 12:20:23 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2007-06-15 12:20:23 +0000 |
commit | 2756b42db2dac000f1b4fde6d45037426e26f9a5 (patch) | |
tree | 4efe9fcd16d9066014b45d972aa5b09dd83c3206 /src/http/modules/perl/ngx_http_perl_module.c | |
parent | 89aa3079bb7c3cc8b71b947971c3a98b1ba67167 (diff) | |
download | nginx-2756b42db2dac000f1b4fde6d45037426e26f9a5.tar.gz nginx-2756b42db2dac000f1b4fde6d45037426e26f9a5.zip |
set worker's perl $$
Diffstat (limited to 'src/http/modules/perl/ngx_http_perl_module.c')
-rw-r--r-- | src/http/modules/perl/ngx_http_perl_module.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c index b8352f056..6e4c42787 100644 --- a/src/http/modules/perl/ngx_http_perl_module.c +++ b/src/http/modules/perl/ngx_http_perl_module.c @@ -67,6 +67,7 @@ static char *ngx_http_perl_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); static void ngx_http_perl_cleanup_perl(void *data); #endif +static ngx_int_t ngx_http_perl_init_worker(ngx_cycle_t *cycle); static void ngx_http_perl_exit(ngx_cycle_t *cycle); @@ -126,7 +127,7 @@ ngx_module_t ngx_http_perl_module = { NGX_HTTP_MODULE, /* module type */ NULL, /* init master */ NULL, /* init module */ - NULL, /* init process */ + ngx_http_perl_init_worker, /* init process */ NULL, /* init thread */ NULL, /* exit thread */ NULL, /* exit process */ @@ -1004,6 +1005,16 @@ ngx_http_perl_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } +static ngx_int_t +ngx_http_perl_init_worker(ngx_cycle_t *cycle) +{ + /* set worker's $$ */ + + sv_setiv(GvSV(gv_fetchpv("$", TRUE, SVt_PV)), (I32) ngx_pid); + + return NGX_OK; +} + static void ngx_http_perl_exit(ngx_cycle_t *cycle) { |