Skip to content

Commit a3c5567

Browse files
committed
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 86067f0 commit a3c5567

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/node_main.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
#ifdef _WIN32
44
#include <VersionHelpers.h>
5+
#include <WinError.h>
56

67
int wmain(int argc, wchar_t *wargv[]) {
78
if (!IsWindows7OrGreater()) {
89
fprintf(stderr, "This application is only supported on Windows 7, "
910
"Windows Server 2008 R2, or higher.");
10-
exit(1);
11+
exit(ERROR_EXE_MACHINE_TYPE_MISMATCH);
1112
}
1213

1314
// Convert argv to to UTF8

0 commit comments

Comments
 (0)