Skip to content

Commit

Permalink
Fix exporting JS functions
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyStreamlabs committed Oct 17, 2018
1 parent 34d6d0b commit a2f1b47
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions crash-handler-module/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = require('./crash_handler.node');

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const crash_handler = require('./crash-handler.node');
const net = require('net');

function tryConnect(buffer, attempt = 5, waitMs = 100) {
Expand All @@ -20,7 +21,7 @@ function tryConnect(buffer, attempt = 5, waitMs = 100) {
});
}

function registerProcess(isCritial = false) {
function registerProcess(pid, isCritial = false) {
const buffer = new Buffer(512);
let offset = 0;
buffer.writeUInt32LE(0, offset++);
Expand Down Expand Up @@ -50,7 +51,7 @@ function terminateCrashHandler(pid) {

function startCrashHandler() {
const { spawn } = require('child_process');
const subprocess = spawn('./crash-handler-process.exe', {
const subprocess = spawn('./node_modules/crash-handler/crash-handler-process.exe', {
detached: true,
stdio: 'ignore'
});
Expand All @@ -60,4 +61,6 @@ function startCrashHandler() {
exports.startCrashHandler = startCrashHandler;
exports.registerProcess = registerProcess;
exports.unregisterProcess = unregisterProcess;
exports.terminateCrashHandler = terminateCrashHandler;
exports.terminateCrashHandler = terminateCrashHandler;

exports = crash_handler;

0 comments on commit a2f1b47

Please sign in to comment.