Mercurial > hg > nginx
changeset 1257:927b06411194
set worker's perl $$
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Fri, 15 Jun 2007 12:20:23 +0000 |
parents | b363902309c2 |
children | 5076d97b9cf0 |
files | src/http/modules/perl/ngx_http_perl_module.c |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/perl/ngx_http_perl_module.c Thu Jun 14 05:48:47 2007 +0000 +++ b/src/http/modules/perl/ngx_http_perl_module.c Fri Jun 15 12:20:23 2007 +0000 @@ -67,6 +67,7 @@ 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_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 @@ } +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) {