]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 266337 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 28 May 2010 20:55:47 +0000 (20:55 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 28 May 2010 20:55:47 +0000 (20:55 +0000)
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

main/asterisk.c

index 147b3042b482ad359d1b78ffad1b416abe960537..5f37fc03e9963dfdeb081ae4e2468de9a32222d7 100644 (file)
@@ -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;
 }