From: Cheng Zhao Date: Thu, 5 Sep 2013 01:49:22 +0000 (+0800) Subject: Also fix nested child_process.fork on Windows. X-Git-Tag: v0.4.4~5^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=84a3eb5411e9d94b7192c663220e2b40bb0f52ff;p=electron.git Also fix nested child_process.fork on Windows. --- diff --git a/app/atom_main.cc b/app/atom_main.cc index 2317c9a9..0dfeb386 100644 --- a/app/atom_main.cc +++ b/app/atom_main.cc @@ -23,7 +23,8 @@ int Start(int argc, char *argv[]); int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) { int argc = 0; wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - if (argc > 1 && wcscmp(wargv[1], L"--atom-child_process-fork") == 0) { + char* node_indicator = getenv("ATOM_SHELL_INTERNAL_RUN_AS_NODE"); + if (node_indicator != NULL && strcmp(node_indicator, "1") == 0) // Convert argv to to UTF8 char** argv = new char*[argc]; for (int i = 0; i < argc; i++) { @@ -58,8 +59,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) { } } // Now that conversion is done, we can finally start. - argv[1] = argv[0]; - return node::Start(argc - 1, argv + 1); + return node::Start(argc, argv); } sandbox::SandboxInterfaceInfo sandbox_info = {0};