# HG changeset patch # User Igor Sysoev # Date 1240510948 0 # Node ID 1983932b807592695c11c399c5f76311f979e84c # Parent e50a2faac31d849e9b3f2d2244674c129a141509 pass command lines options to workers diff --git a/src/core/nginx.c b/src/core/nginx.c --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -540,6 +540,8 @@ ngx_exec_new_binary(ngx_cycle_t *cycle, ngx_core_conf_t *ccf; ngx_listening_t *ls; + ngx_memzero(&ctx, sizeof(ngx_exec_ctx_t)); + ctx.path = argv[0]; ctx.name = "new binary process"; ctx.argv = argv; diff --git a/src/os/win32/ngx_process.c b/src/os/win32/ngx_process.c --- a/src/os/win32/ngx_process.c +++ b/src/os/win32/ngx_process.c @@ -58,6 +58,7 @@ ngx_spawn_process(ngx_cycle_t *cycle, ch ctx.path = file; ctx.name = name; + ctx.args = GetCommandLine(); ctx.argv = NULL; ctx.envp = NULL; @@ -195,7 +196,7 @@ ngx_execute(ngx_cycle_t *cycle, ngx_exec ngx_memzero(&pi, sizeof(PROCESS_INFORMATION)); - if (CreateProcess(ctx->path, /* STUB */ NULL, + if (CreateProcess(ctx->path, ctx->args, NULL, NULL, 0, CREATE_NO_WINDOW, NULL, NULL, &si, &pi) == 0) { diff --git a/src/os/win32/ngx_process.h b/src/os/win32/ngx_process.h --- a/src/os/win32/ngx_process.h +++ b/src/os/win32/ngx_process.h @@ -41,6 +41,7 @@ typedef struct { typedef struct { char *path; char *name; + char *args; char *const *argv; char *const *envp; HANDLE child;