Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation for childProcess.kill(signal): signal can be a number #27750

Closed
ehmicky opened this issue May 17, 2019 · 2 comments
Closed
Labels
child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors.

Comments

@ehmicky
Copy link

ehmicky commented May 17, 2019

With childProcess.kill(signal), signal is documented as being a string.

However in the code, signal can be either a string or a number.

@ZYSzys ZYSzys added child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors. labels May 18, 2019
@himself65
Copy link
Member

himself65 commented May 18, 2019

I think the source code is here:

ChildProcess.prototype.kill = function(sig) {
const signal = sig === 0 ? sig :
convertToValidSignal(sig === undefined ? 'SIGTERM' : sig);
if (this._handle) {
var err = this._handle.kill(signal);
if (err === 0) {
/* Success. */
this.killed = true;
return true;
}
if (err === UV_ESRCH) {
/* Already dead. */
} else if (err === UV_EINVAL || err === UV_ENOSYS) {
/* The underlying platform doesn't support this signal. */
throw errnoException(err, 'kill');
} else {
/* Other error, almost certainly EPERM. */
this.emit('error', errnoException(err, 'kill'));
}
}
/* Kill didn't succeed. */
return false;
};

@ZYSzys
Copy link
Member

ZYSzys commented May 20, 2019

Fixed via #27760.

@ZYSzys ZYSzys closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
child_process Issues and PRs related to the child_process subsystem. doc Issues and PRs related to the documentations. good first issue Issues that are suitable for first-time contributors.
Projects
None yet
Development

No branches or pull requests

3 participants