# HG changeset patch # User Kim Alvefur # Date 1428437148 -7200 # Node ID 4d38b8c03dfe57f71bb22729be70ca0b6992d825 # Parent 1a6d6221c5f619167a42cb7ec64ec9cde4eaa55c mod_measure_memory: Silence warnings [luacheck] diff -r 1a6d6221c5f6 -r 4d38b8c03dfe mod_measure_memory/mod_measure_memory.lua --- a/mod_measure_memory/mod_measure_memory.lua Tue Apr 07 18:12:40 2015 +0200 +++ b/mod_measure_memory/mod_measure_memory.lua Tue Apr 07 22:05:48 2015 +0200 @@ -5,8 +5,8 @@ local measures = {}; setmetatable(measures, { - __index = function (t, k, m) - m = measure("sizes", "memory."..k); t[k] = m; return m; + __index = function (t, k) + local m = measure("sizes", "memory."..k); t[k] = m; return m; end }); @@ -23,9 +23,7 @@ end); end -local statm = io.open("/proc/self/statm"); -if statm then - statm:close(); +if require"lfs".attributes("/proc/self/statm", "mode") == "file" then local pagesize = module:get_option_number("memory_pagesize", 4096); -- getconf PAGESIZE module:hook("stats-update", function ()