comparison src/os/win32/ngx_process.c @ 2745:1983932b8075

pass command lines options to workers
author Igor Sysoev <igor@sysoev.ru>
date Thu, 23 Apr 2009 18:22:28 +0000
parents d52cf82d0d77
children 3f287b615408
comparison
equal deleted inserted replaced
2744:e50a2faac31d 2745:1983932b8075
56 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cycle->log, 0, 56 ngx_log_debug1(NGX_LOG_DEBUG_CORE, cycle->log, 0,
57 "GetModuleFileName: \"%s\"", file); 57 "GetModuleFileName: \"%s\"", file);
58 58
59 ctx.path = file; 59 ctx.path = file;
60 ctx.name = name; 60 ctx.name = name;
61 ctx.args = GetCommandLine();
61 ctx.argv = NULL; 62 ctx.argv = NULL;
62 ctx.envp = NULL; 63 ctx.envp = NULL;
63 64
64 pid = ngx_execute(cycle, &ctx); 65 pid = ngx_execute(cycle, &ctx);
65 66
193 ngx_memzero(&si, sizeof(STARTUPINFO)); 194 ngx_memzero(&si, sizeof(STARTUPINFO));
194 si.cb = sizeof(STARTUPINFO); 195 si.cb = sizeof(STARTUPINFO);
195 196
196 ngx_memzero(&pi, sizeof(PROCESS_INFORMATION)); 197 ngx_memzero(&pi, sizeof(PROCESS_INFORMATION));
197 198
198 if (CreateProcess(ctx->path, /* STUB */ NULL, 199 if (CreateProcess(ctx->path, ctx->args,
199 NULL, NULL, 0, CREATE_NO_WINDOW, NULL, NULL, &si, &pi) 200 NULL, NULL, 0, CREATE_NO_WINDOW, NULL, NULL, &si, &pi)
200 == 0) 201 == 0)
201 { 202 {
202 ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_errno, 203 ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_errno,
203 "CreateProcess(\"%s\") failed", ngx_argv[0]); 204 "CreateProcess(\"%s\") failed", ngx_argv[0]);