diff options
author | Kim Alvefur <zash@zash.se> | 2014-11-09 20:32:33 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-11-09 20:32:33 +0100 |
commit | 3b5fa59a5496cd0d19e2a0dac067188d61d76c36 (patch) | |
tree | 00a4652d294babdf3be6f9add9a811a0e180a5d8 /plugins/mod_admin_telnet.lua | |
parent | 763567fa0236b0b80e0271ed1d3325501b979ee1 (diff) | |
parent | 486335f3dbc84dacf253120f544f1d2ee026cf94 (diff) | |
download | prosody-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.lua | 3 |
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"); |