From a080f1a0954931d57a2b7a8bd65703d0b9ed9fa3 Mon Sep 17 00:00:00 2001 From: yorkie Date: Sun, 21 Aug 2016 13:17:47 +0800 Subject: [PATCH] src,win: use correct exit code in old versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If `IsWindows7OrGreater()` returns `false`, the Node.js program should exit with a more specific code ERROR_EXE_MACHINE_TYPE_MISMATCH instead the code 0x1(ERROR_INVALID_FUNCTION) PR-URL: https://github.com/nodejs/node/pull/8204 Reviewed-By: João Reis Reviewed-By: Anna Henningsen --- src/node_main.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_main.cc b/src/node_main.cc index bde397562490e0..16bda81ae64091 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -2,12 +2,13 @@ #ifdef _WIN32 #include +#include int wmain(int argc, wchar_t *wargv[]) { if (!IsWindows7OrGreater()) { fprintf(stderr, "This application is only supported on Windows 7, " "Windows Server 2008 R2, or higher."); - exit(1); + exit(ERROR_EXE_MACHINE_TYPE_MISMATCH); } // Convert argv to to UTF8