aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-28 20:55:47 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-28 20:55:47 +0000
commit1dcb89a5ce07bf1a71aa5dc734b6da4021af6ff4 (patch)
treea829de19f7c44b02888434b386ab574dfeb3c6db
parentdd6a958af6e4b48544c1f4bdbb30daf6f9c90d09 (diff)
Merged revisions 266337 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r266337 | tilghman | 2010-05-28 15:53:04 -0500 (Fri, 28 May 2010) | 1 line Only report swap on platforms which can examine those statistics ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@266338 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/asterisk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 147b3042b..5f37fc03e 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -562,7 +562,8 @@ static int swapmode(int *used, int *total)
static char *handle_show_sysinfo(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
{
uint64_t physmem, freeram;
- uint64_t totalswap = 0, freeswap = 0;
+ uint64_t freeswap = 0;
+ int totalswap = 0;
int nprocs = 0;
long uptime = 0;
#if defined(HAVE_SYSINFO)
@@ -647,8 +648,10 @@ static char *handle_show_sysinfo(struct ast_cli_entry *e, int cmd, struct ast_cl
#if defined(HAVE_SYSINFO)
ast_cli(a->fd, " Buffer RAM: %" PRIu64 " KiB\n", ((uint64_t) sys_info.bufferram * sys_info.mem_unit) / 1024);
#endif
- ast_cli(a->fd, " Total Swap Space: %" PRIu64 " KiB\n", totalswap);
+#if defined (HAVE_SYSCTL) && defined(HAVE_SWAPCTL)
+ ast_cli(a->fd, " Total Swap Space: %u KiB\n", totalswap);
ast_cli(a->fd, " Free Swap Space: %" PRIu64 " KiB\n\n", freeswap);
+#endif
ast_cli(a->fd, " Number of Processes: %d \n\n", nprocs);
return CLI_SUCCESS;
}