changeset 2745:1983932b8075

pass command lines options to workers
author Igor Sysoev <igor@sysoev.ru>
date Thu, 23 Apr 2009 18:22:28 +0000
parents e50a2faac31d
children 7bbebf565664
files src/core/nginx.c src/os/win32/ngx_process.c src/os/win32/ngx_process.h
diffstat 3 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/nginx.c	Thu Apr 23 16:38:59 2009 +0000
+++ b/src/core/nginx.c	Thu Apr 23 18:22:28 2009 +0000
@@ -540,6 +540,8 @@
     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;
--- a/src/os/win32/ngx_process.c	Thu Apr 23 16:38:59 2009 +0000
+++ b/src/os/win32/ngx_process.c	Thu Apr 23 18:22:28 2009 +0000
@@ -58,6 +58,7 @@
 
     ctx.path = file;
     ctx.name = name;
+    ctx.args = GetCommandLine();
     ctx.argv = NULL;
     ctx.envp = NULL;
 
@@ -195,7 +196,7 @@
 
     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)
     {
--- a/src/os/win32/ngx_process.h	Thu Apr 23 16:38:59 2009 +0000
+++ b/src/os/win32/ngx_process.h	Thu Apr 23 18:22:28 2009 +0000
@@ -41,6 +41,7 @@
 typedef struct {
     char                   *path;
     char                   *name;
+    char                   *args;
     char *const            *argv;
     char *const            *envp;
     HANDLE                  child;