Software /
code /
prosody
Diff
plugins/mod_admin_telnet.lua @ 6511:5f9389af5115
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 09 Nov 2014 20:32:33 +0100 |
parent | 6383:ec8878113907 |
parent | 6503:8437058c4226 |
child | 6534:b89406fa076c |
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua Sun Oct 26 20:58:02 2014 +0100 +++ b/plugins/mod_admin_telnet.lua Sun Nov 09 20:32:33 2014 +0100 @@ -27,6 +27,7 @@ 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 @@ 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");