Permalink
Browse files

src,win: use correct exit code in old versions

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: #8204
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information...
yorkie committed Aug 21, 2016
1 parent 86067f0 commit a3c5567eb47738bc8a95592bf43343008bb80861
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/node_main.cc
@@ -2,12 +2,13 @@
#ifdef _WIN32
#include <VersionHelpers.h>
#include <WinError.h>
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

0 comments on commit a3c5567

Please sign in to comment.