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
commit3b5fa59a5496cd0d19e2a0dac067188d61d76c36 (patch)
tree00a4652d294babdf3be6f9add9a811a0e180a5d8 /plugins/mod_admin_telnet.lua
parent763567fa0236b0b80e0271ed1d3325501b979ee1 (diff)
parent486335f3dbc84dacf253120f544f1d2ee026cf94 (diff)
downloadprosody-3b5fa59a5496cd0d19e2a0dac067188d61d76c36.tar.gz
prosody-3b5fa59a5496cd0d19e2a0dac067188d61d76c36.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");