]> git.kaiwu.me - nginx.git/commitdiff
pass command lines options to workers
authorIgor Sysoev <igor@sysoev.ru>
Thu, 23 Apr 2009 18:22:28 +0000 (18:22 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 23 Apr 2009 18:22:28 +0000 (18:22 +0000)
src/core/nginx.c
src/os/win32/ngx_process.c
src/os/win32/ngx_process.h

index 63185bcbf79e50eebadfa11faf2c45ef3c86706f..f08af79dedaa3c65942f20c295dfb201b4a1aa9f 100644 (file)
@@ -540,6 +540,8 @@ ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv)
     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;
index bd49340acd8d55dbc140dbf56401baf9862ac4c1..bbc7afa9e537de71a07b155488375f52548efb32 100644 (file)
@@ -58,6 +58,7 @@ ngx_spawn_process(ngx_cycle_t *cycle, char *name, ngx_int_t respawn)
 
     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_ctx_t *ctx)
 
     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)
     {
index 49eef785c671bd2aa38eec950f5bd381522228fd..520a55bb29ae021da1b9b30dc59c7cc8ebbbfb55 100644 (file)
@@ -41,6 +41,7 @@ typedef struct {
 typedef struct {
     char                   *path;
     char                   *name;
+    char                   *args;
     char *const            *argv;
     char *const            *envp;
     HANDLE                  child;