1
0
mirror of https://github.com/lxsang/antd-lua-plugin synced 2025-02-20 17:52:47 +01:00

minor lib fix

This commit is contained in:
lxsang 2019-05-07 14:33:35 +02:00
parent 55567f9c14
commit 80f77a1f75

View File

@ -117,9 +117,18 @@ static int l_fork(lua_State* L)
static int l_waitpid(lua_State* L)
{
int pid = luaL_checknumber(L,1);
int nohang = luaL_checknumber(L,2);
pid_t st;
int status;
waitpid(pid, &status, 0);
lua_pushnumber(L, status);
if(nohang)
{
st = waitpid(pid, &status, WNOHANG);
}
else
{
st = waitpid(pid, &status, 0);
}
lua_pushnumber(L, st);
return 1;
}
static int l_kill(lua_State* L)