awesome.kill: use luaL_checknumber
Fixes https://github.com/awesomeWM/awesome/issues/2534.
This commit is contained in:
parent
a2cd918603
commit
6f2ab576b8
8
luaa.c
8
luaa.c
|
@ -252,18 +252,18 @@ luaA_restart(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Send a signal to a process identified by its process id. See
|
/** Send a signal to a process.
|
||||||
* `awesome.unix_signal` for a list of signals.
|
|
||||||
* @tparam integer pid Process identifier. 0 and negative values have special
|
* @tparam integer pid Process identifier. 0 and negative values have special
|
||||||
* meaning. See `man 3 kill`.
|
* 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
|
* @treturn boolean true if the signal was successfully sent, else false
|
||||||
* @function kill
|
* @function kill
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
luaA_kill(lua_State *L)
|
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 sig = luaA_checknumber_range(L, 2, 0, INT_MAX);
|
||||||
|
|
||||||
int result = kill(pid, sig);
|
int result = kill(pid, sig);
|
||||||
|
|
Loading…
Reference in New Issue