Merge pull request #2294 from blueyed/kill

awesome.kill: allow negative PIDs (and 0) to support process groups
This commit is contained in:
mergify[bot] 2018-07-20 14:32:14 +00:00 committed by GitHub
commit abf847961e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

5
luaa.c
View File

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