httpclient: Added missing import
authorSteven Barth <steven@midlink.org>
Mon, 9 Mar 2009 20:06:36 +0000 (20:06 +0000)
committerSteven Barth <steven@midlink.org>
Mon, 9 Mar 2009 20:06:36 +0000 (20:06 +0000)
nixio: waitpid() returns 0 with WNOHANG and no terminated childs

libs/httpclient/luasrc/httpclient/receiver.lua
libs/nixio/src/process.c

index c12a673..ad2ac8d 100644 (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"
 
index e8f0cdc..69f19b7 100644 (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);