diff options
author | Kim Alvefur <zash@zash.se> | 2014-10-27 11:12:08 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-10-27 11:12:08 +0100 |
commit | 4c8f1bc90a5a869031e37a068342ba51c487f631 (patch) | |
tree | 665d9500bf4b3c7aca8cc8b7bb16e44e2143add3 | |
parent | 29326acffa1d582bed7759e6302d2c4b4bced884 (diff) | |
download | prosody-4c8f1bc90a5a869031e37a068342ba51c487f631.tar.gz prosody-4c8f1bc90a5a869031e37a068342ba51c487f631.zip |
mod_admin_telnet: Soft-reqire util.pposix for server:memory()
-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 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"); |