aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-28 20:53:04 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-28 20:53:04 +0000
commit1297a5987850c9af9eef4179d6c4ae7a467bd49a (patch)
treec76a9d9f5bd9361edaf8675f47062cb859a3617b /main
parent79090a6d5aa0bf1ed084592c3ddfd3a40b4b3e20 (diff)
Only report swap on platforms which can examine those statistics
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266337 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index e69f2ce03..9ae67a9d8 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -570,7 +570,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)
@@ -655,8 +656,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;
}