mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +00:00
core: Fix unused variable error in handle_show_sysinfo.
Apparently in OSX it's possible for OSX to HAVE_SYSCTL but not HAVE_SYSINFO or HAVE_SWAPCTL. In this case freeswap caused an unused variable error. ASTERISK-26563 #close Change-Id: I8ec5b1897b786cc1abaf62264aa75039eea05510
This commit is contained in:
@@ -727,7 +727,9 @@ static int swapmode(int *used, int *total)
|
|||||||
static char *handle_show_sysinfo(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
static char *handle_show_sysinfo(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
|
||||||
{
|
{
|
||||||
uint64_t physmem, freeram;
|
uint64_t physmem, freeram;
|
||||||
|
#if defined(HAVE_SYSINFO) || defined(HAVE_SWAPCTL)
|
||||||
uint64_t freeswap = 0;
|
uint64_t freeswap = 0;
|
||||||
|
#endif
|
||||||
int nprocs = 0;
|
int nprocs = 0;
|
||||||
long uptime = 0;
|
long uptime = 0;
|
||||||
int totalswap = 0;
|
int totalswap = 0;
|
||||||
@@ -817,7 +819,7 @@ static char *handle_show_sysinfo(struct ast_cli_entry *e, int cmd, struct ast_cl
|
|||||||
#if defined(HAVE_SYSINFO)
|
#if defined(HAVE_SYSINFO)
|
||||||
ast_cli(a->fd, " Buffer RAM: %" PRIu64 " KiB\n", ((uint64_t) sys_info.bufferram * sys_info.mem_unit) / 1024);
|
ast_cli(a->fd, " Buffer RAM: %" PRIu64 " KiB\n", ((uint64_t) sys_info.bufferram * sys_info.mem_unit) / 1024);
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_SWAPCTL) || defined(HAVE_SYSINFO)
|
#if defined(HAVE_SYSINFO) || defined(HAVE_SWAPCTL)
|
||||||
ast_cli(a->fd, " Total Swap Space: %d KiB\n", totalswap);
|
ast_cli(a->fd, " Total Swap Space: %d KiB\n", totalswap);
|
||||||
ast_cli(a->fd, " Free Swap Space: %" PRIu64 " KiB\n\n", freeswap);
|
ast_cli(a->fd, " Free Swap Space: %" PRIu64 " KiB\n\n", freeswap);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user