summaryrefslogtreecommitdiffhomepage
path: root/libs/core
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-11-09 19:43:13 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-11-09 19:43:13 +0000
commit472ffe69a9919a73991a2670762d3bce0b59c9f3 (patch)
treeeb8976921b58161fc6afce4cf6efafdbb86ff83e /libs/core
parent639664a40e207b76838b657324b23ed425d19148 (diff)
libs/core: restore original implementation of copcall() and coxpcall(), solves issues with RPC UCI endpoint
Diffstat (limited to 'libs/core')
-rw-r--r--libs/core/luasrc/util.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/core/luasrc/util.lua b/libs/core/luasrc/util.lua
index a248026f1..79efa5545 100644
--- a/libs/core/luasrc/util.lua
+++ b/libs/core/luasrc/util.lua
@@ -787,19 +787,19 @@ function copcall(f, ...)
end
-- Handle return value of protected call
-function handleReturnValue(err, co, status, arg1, arg2, arg3, arg4, arg5)
+function handleReturnValue(err, co, status, ...)
if not status then
- return false, err(debug.traceback(co, arg1), arg1, arg2, arg3, arg4, arg5)
+ return false, err(debug.traceback(co, (...)), ...)
end
if coroutine.status(co) ~= 'suspended' then
- return true, arg1, arg2, arg3, arg4, arg5
+ return true, ...
end
- return performResume(err, co, coroutine.yield(arg1, arg2, arg3, arg4, arg5))
+ return performResume(err, co, coroutine.yield(...))
end
-- Resume execution of protected function call
-function performResume(err, co, arg1, arg2, arg3, arg4, arg5)
- return handleReturnValue(err, co, coroutine.resume(co, arg1, arg2, arg3, arg4, arg5))
+function performResume(err, co, ...)
+ return handleReturnValue(err, co, coroutine.resume(co, ...))
end