Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
os._exit(127);
} else {
// parent
//
// wait until child has started
os.close(errorPipe[1]);
var r = os.read(errorPipe[0]);
if (r.length === 0) {
// child started succesfully
r = 0;
} else {
var p = os.waitpid(pid, 0);
assert.equal(p.pid, pid);
var errorno = Number.parseInt(new TextDecoder().decode(r));
r = new Error('Faild to spawn child: [errno ' + errorno + '] ' + errno.strerror(errorno));
r.errno = errorno;
}
// close fds
var fds = [devNull, errorPipe[0], stdinPipe[0], stdoutPipe[1], stderrPipe[1]];
fds.forEach(function(fd) {
if (fd > os.STDERR_FILENO) {
silentClose(fd);
}
});
// throw error, if there was one
if (r instanceof Error) {
throw r;
}
function checkFile() {
if (this._f === null) {
const e = new Error('[Errno ' + errno.EBADF + '] ' + errno.strerror(errno.EBADF));
e.errno = errno.EBADF;
throw e;
}
}
function checkFile() {
if (this._f === null) {
const e = new Error('[Errno ' + errno.EBADF + '] ' + errno.strerror(errno.EBADF));
e.errno = errno.EBADF;
throw e;
}
}
function checkSocket() {
if (this._fd === -1) {
const e = new Error('[Errno ' + errno.EBADF + '] ' + errno.strerror(errno.EBADF));
e.errno = errno.EBADF;
throw e;
}
}