aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_telnet.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-11-09 20:32:33 +0100
committerKim Alvefur <zash@zash.se>2014-11-09 20:32:33 +0100
commit639527b16590d9032d4340c5e6570909c6cdc776 (patch)
tree00a4652d294babdf3be6f9add9a811a0e180a5d8 /plugins/mod_admin_telnet.lua
parentcebfb0bf3e29df5aac96cb0d41adb8e356921dc8 (diff)
parent61b8eb49edf8e9a2d1ae2d55a898fc6e69a6f59e (diff)
downloadprosody-639527b16590d9032d4340c5e6570909c6cdc776.tar.gz
prosody-639527b16590d9032d4340c5e6570909c6cdc776.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_admin_telnet.lua')
-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 55eb2e55..9185ac1b 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");