X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=libs%2Fcore%2Fluasrc%2Futil.lua;fp=libs%2Fcore%2Fluasrc%2Futil.lua;h=357b05df5a4d893b709a784f09b2c3968f124def;hb=5dea416e833aa0bb72ff693f853765514bb869a4;hp=f45a1f966e52ed62a23d301468753d8721244a19;hpb=c7904006718a345eeef576ef415209d3c2d5b962;p=project%2Fluci.git diff --git a/libs/core/luasrc/util.lua b/libs/core/luasrc/util.lua index f45a1f966..357b05df5 100644 --- a/libs/core/luasrc/util.lua +++ b/libs/core/luasrc/util.lua @@ -771,19 +771,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