From 2e79c969c03cba4ecdb35ea71fd31613e85fb7ff Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 9 Mar 2009 20:06:36 +0000 Subject: [PATCH] httpclient: Added missing import nixio: waitpid() returns 0 with WNOHANG and no terminated childs --- libs/httpclient/luasrc/httpclient/receiver.lua | 2 +- libs/nixio/src/process.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/httpclient/luasrc/httpclient/receiver.lua b/libs/httpclient/luasrc/httpclient/receiver.lua index c12a673b3..ad2ac8db7 100644 --- a/libs/httpclient/luasrc/httpclient/receiver.lua +++ b/libs/httpclient/luasrc/httpclient/receiver.lua @@ -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" diff --git a/libs/nixio/src/process.c b/libs/nixio/src/process.c index e8f0cdc50..69f19b7ac 100644 --- a/libs/nixio/src/process.c +++ b/libs/nixio/src/process.c @@ -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); -- 2.25.1