aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-10-27 11:12:08 +0100
committerKim Alvefur <zash@zash.se>2014-10-27 11:12:08 +0100
commitcf9da1469df1680f33f003ae493f81ed9c50b238 (patch)
tree665d9500bf4b3c7aca8cc8b7bb16e44e2143add3
parent8f2d2b9bea483c6a4cf1324af6306d60ae8d91b9 (diff)
downloadprosody-cf9da1469df1680f33f003ae493f81ed9c50b238.tar.gz
prosody-cf9da1469df1680f33f003ae493f81ed9c50b238.zip
mod_admin_telnet: Soft-reqire util.pposix for server:memory()
-rw-r--r--plugins/mod_admin_telnet.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua
index a17b1c57..660fb33b 100644
--- a/plugins/mod_admin_telnet.lua
+++ b/plugins/mod_admin_telnet.lua
@@ -27,6 +27,7 @@ local set, array = require "util.set", require "util.array";
local cert_verify_identity = require "util.x509".verify_identity;
local envload = require "util.envload".envload;
local envloadfile = require "util.envload".envloadfile;
+local has_pposix, pposix = pcall(require, "util.pposix");
local commands = module:shared("commands")
local def_env = module:shared("env");
@@ -322,7 +323,7 @@ local function human(kb)
end
function def_env.server:memory()
- if not pposix.meminfo then
+ if not has_pposix or not pposix.meminfo then
return true, "Lua is using "..collectgarbage("count");
end
local mem, lua_mem = pposix.meminfo(), collectgarbage("count");