[Asterisk-code-review] core: Fix unused variable error in handle show sysinfo. (asterisk[15])

Joshua Colp asteriskteam at digium.com
Thu Dec 21 05:46:52 CST 2017


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/7674 )

Change subject: core: Fix unused variable error in handle_show_sysinfo.
......................................................................

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
---
M main/asterisk.c
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit



diff --git a/main/asterisk.c b/main/asterisk.c
index 30ad844..450feb4 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -727,7 +727,9 @@
 static char *handle_show_sysinfo(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	uint64_t physmem, freeram;
+#if defined(HAVE_SYSINFO) || defined(HAVE_SWAPCTL)
 	uint64_t freeswap = 0;
+#endif
 	int nprocs = 0;
 	long uptime = 0;
 	int totalswap = 0;
@@ -817,7 +819,7 @@
 #if defined(HAVE_SYSINFO)
 	ast_cli(a->fd, "  Buffer RAM:                %" PRIu64 " KiB\n", ((uint64_t) sys_info.bufferram * sys_info.mem_unit) / 1024);
 #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, "  Free Swap Space:           %" PRIu64 " KiB\n\n", freeswap);
 #endif

-- 
To view, visit https://gerrit.asterisk.org/7674
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I8ec5b1897b786cc1abaf62264aa75039eea05510
Gerrit-Change-Number: 7674
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171221/94b86e17/attachment-0001.html>


More information about the asterisk-code-review mailing list