httpclient: Added missing import

nixio: waitpid() returns 0 with WNOHANG and no terminated childs
This commit is contained in:
Steven Barth 2009-03-09 20:06:36 +00:00
parent 7b5d67305e
commit 2e79c969c0
2 changed files with 5 additions and 2 deletions

View file

@ -17,7 +17,7 @@ local nixio = require "nixio"
local httpc = require "luci.httpclient"
local ltn12 = require "luci.ltn12"
local print, tonumber, require = print, tonumber, require
local print, tonumber, require, unpack = print, tonumber, require, unpack
module "luci.httpclient.receiver"

View file

@ -59,7 +59,10 @@ static int nixio_wait(lua_State *L) {
pidout = waitpid(pidin, &status, options);
} while (pidout == -1 && errno == EINTR);
if (pidout == -1) {
if (pidout == 0) {
lua_pushboolean(L, 0);
return 1;
} else if (pidout == -1) {
return nixio__perror(L);
} else {
lua_pushinteger(L, pidout);