Skip to content

Commit

Permalink
Mask function os.exit in LuCI fastcgi handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Waldvogel committed Oct 16, 2012
1 parent b40a28f commit b8f962c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion luci-sgi-fcgi/files/root/usr/lib/lua/luci/sgi/fcgi.lua
Expand Up @@ -7,9 +7,16 @@ require("luci.cacheloader")

luci.dispatcher.indexcache = "/tmp/luci-indexcache"

exectime = os.clock()
-- os.exit would exit the fastcgi server
-- therefore we replace it with a dummy function
function os_exit_dummy(code)
end
_G["os"]["exit"] = os_exit_dummy

os.exit(0)

function main(env, req)
exectime = os.clock()
local r = luci.http.Request(env, limitsource(req, tonumber(env.CONTENT_LENGTH)), ltn12.sink.file(io.stderr))
local x = coroutine.create(luci.dispatcher.httpdispatch)
local hcache = {}
Expand Down

0 comments on commit b8f962c

Please sign in to comment.