From: Tilghman Lesher Date: Fri, 28 May 2010 20:55:47 +0000 (+0000) Subject: Merged revisions 266337 via svnmerge from X-Git-Tag: 1.6.2.9-rc1~2^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfec2260a82465400e6e285b11df8066d5603236;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@266338 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/asterisk.c b/main/asterisk.c index 147b3042b4..5f37fc03e9 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; }