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

docs: make process_kill signum arg optional #666

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

Bilal2453
Copy link
Contributor

In Libuv, uv_process_kill takes a process and a signum, where the signum is required. In Luv although, in luv_parse_signal, if the input is not an integer and not a string, the default value of SIGTERM is used.

Effectively making signum an optional argument with the default string value sigterm.

@squeek502
Copy link
Member

The relevant code:

luv/src/process.c

Lines 302 to 310 in 9e3c232

static int luv_parse_signal(lua_State* L, int slot) {
if (lua_isnumber(L, slot)) {
return lua_tonumber(L, slot);
}
if (lua_isstring(L, slot)) {
return luv_sig_string_to_num(lua_tostring(L, slot));
}
return SIGTERM;
}

@zhaozg zhaozg merged commit 8ca04df into luvit:master Aug 21, 2023
13 checks passed
@Bilal2453 Bilal2453 deleted the docs-signum-optional branch August 22, 2023 15:27
@Bilal2453
Copy link
Contributor Author

Seems like I forgot uv.kill in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants