Skip to content

Commit

Permalink
src,win: use correct exit code in old versions
Browse files Browse the repository at this point in the history
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 30, 2016
1 parent 86067f0 commit a3c5567
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/node_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a3c5567

Please sign in to comment.