diff --git a/src/vm/js/nqp-runtime/io.js b/src/vm/js/nqp-runtime/io.js index 65ec2800fc..f35573811c 100644 --- a/src/vm/js/nqp-runtime/io.js +++ b/src/vm/js/nqp-runtime/io.js @@ -553,19 +553,7 @@ op.getsignals = function() { return sigCache; } - const osSigs = (function() { - if (os.platform() === 'win32') { - // Use same sigs defined for _WIN32 in MoarVM - return { - SIGHUP: 1, - SIGKILL: 9, - SIGWINCH: 28, - }; - } - else { - return os.constants.signals; - } - })(); + const osSigs = os.constants.signals; const sigWanted = [ 'SIGHUP', 'SIGINT', 'SIGQUIT', 'SIGILL', 'SIGTRAP', 'SIGABRT', 'SIGEMT', 'SIGFPE', 'SIGKILL', 'SIGBUS', 'SIGSEGV', 'SIGSYS', diff --git a/src/vm/jvm/runtime/org/perl6/nqp/runtime/IOOps.java b/src/vm/jvm/runtime/org/perl6/nqp/runtime/IOOps.java index 0abe144a8b..e4e1aae78d 100644 --- a/src/vm/jvm/runtime/org/perl6/nqp/runtime/IOOps.java +++ b/src/vm/jvm/runtime/org/perl6/nqp/runtime/IOOps.java @@ -88,9 +88,16 @@ private static String getNameFromVal(int signum) { } private static void retrieveValsWin(Map sigWanted) { - // Use same sigs defined for _WIN32 in MoarVM + // Use same sigs defined for _WIN32 in MoarVM and in os.constants.signals on NodeJS sigWanted.put("SIGHUP", 1); + sigWanted.put("SIGINT", 2); + sigWanted.put("SIGILL", 4); + sigWanted.put("SIGFPE", 8); sigWanted.put("SIGKILL", 9); + sigWanted.put("SIGSEGV", 11); + sigWanted.put("SIGTERM", 15); + sigWanted.put("SIGBREAK", 21); + sigWanted.put("SIGABRT", 22); sigWanted.put("SIGWINCH", 28); }