Browse Source

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: https://github.com/nodejs/node/pull/8204
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
v7.x
yorkie 8 years ago
parent
commit
a3c5567eb4
  1. 3
      src/node_main.cc

3
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

Loading…
Cancel
Save