view util/xpcall.lua @ 11830:7fe2fbfbdb1c

mod_posix: Exit with non-zero status code on problems Previously it would default to exit with 0 as status code, meaning success, which is weird.
author Kim Alvefur <zash@zash.se>
date Thu, 30 Sep 2021 23:22:07 +0200
parents cfc7b2f7251e
children d10957394a3c
line wrap: on
line source

local xpcall = xpcall;

if select(2, xpcall(function (x) return x end, function () end,  "test")) ~= "test" then
	xpcall = require"util.compat".xpcall;
end

return {
	xpcall = xpcall;
};