Merge pull request #2535 from blueyed/kill

awesome.kill: use luaL_checknumber
This commit is contained in:
mergify[bot] 2019-01-04 22:32:17 +00:00 committed by GitHub
commit 477c322bc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

8
luaa.c
View File

@ -252,18 +252,18 @@ luaA_restart(lua_State *L)
return 0;
}
/** Send a signal to a process identified by its process id. See
* `awesome.unix_signal` for a list of signals.
/** Send a signal to a process.
* @tparam integer pid Process identifier. 0 and negative values have special
* meaning. See `man 3 kill`.
* @tparam integer sig Signal number
* @tparam integer sig Signal number.
* See `awesome.unix_signal` for a list of signals.
* @treturn boolean true if the signal was successfully sent, else false
* @function kill
*/
static int
luaA_kill(lua_State *L)
{
int pid = lua_tonumber(L, 1);
int pid = luaL_checknumber(L, 1);
int sig = luaA_checknumber_range(L, 2, 0, INT_MAX);
int result = kill(pid, sig);