From 3ddf25315df1a1dc0a3cd023fc3949a57218624f Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Sat, 28 Nov 2026 08:05:44 -0500 Subject: [PATCH] * test/modules/lua/htdocs/test1/lua/body.lua (rss): Return 0 where there is no /proc/self/status, rather than failing the request, so that test_lua_004_01_read passes on macOS. --- test/modules/lua/htdocs/test1/lua/body.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/modules/lua/htdocs/test1/lua/body.lua b/test/modules/lua/htdocs/test1/lua/body.lua index 518ffb1a6b2..bd5734b82e5 100644 --- a/test/modules/lua/htdocs/test1/lua/body.lua +++ b/test/modules/lua/htdocs/test1/lua/body.lua @@ -5,12 +5,16 @@ -- filemax the body stored to a file with a 100 byte limit -- fileover the body stored over the file left by an earlier request +-- 0 where there is no /proc, as on macOS. local function rss() collectgarbage() - for line in io.lines("/proc/self/status") do + local f = io.open("/proc/self/status") + if not f then return 0 end + for line in f:lines() do local kb = line:match("^VmRSS:%s+(%d+)") - if kb then return tonumber(kb) end + if kb then f:close() return tonumber(kb) end end + f:close() return 0 end