<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8071">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: Fix unused variable error in handle_show_sysinfo.<br><br>The previous fix broke the case<br>HAVE_SYSINFO = no<br>HAVE_SYSCTL = yes<br>HAVE_SWAPCTL = no<br>which occurs on FreeBSD 11.1 for example.<br><br>ASTERISK-26563<br><br>Change-Id: If77c39bc75f0b83a6c8a24ecb2fa69be8846160a<br>---<br>M main/asterisk.c<br>1 file changed, 7 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/71/8071/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/asterisk.c b/main/asterisk.c<br>index 01107e2..d2230dc 100644<br>--- a/main/asterisk.c<br>+++ b/main/asterisk.c<br>@@ -782,12 +782,6 @@<br> ast_free(swdev);<br> return 1;<br> }<br>-#elif defined(HAVE_SYSCTL) && !defined(HAVE_SYSINFO)<br>-static int swapmode(int *used, int *total)<br>-{<br>- *used = *total = 0;<br>- return 1;<br>-}<br> #endif<br> <br> #if defined(HAVE_SYSINFO) || defined(HAVE_SYSCTL)<br>@@ -796,11 +790,11 @@<br> {<br> uint64_t physmem, freeram;<br> #if defined(HAVE_SYSINFO) || defined(HAVE_SWAPCTL)<br>+ int totalswap = 0;<br> uint64_t freeswap = 0;<br> #endif<br> int nprocs = 0;<br> long uptime = 0;<br>- int totalswap = 0;<br> #if defined(HAVE_SYSINFO)<br> struct sysinfo sys_info;<br> #elif defined(HAVE_SYSCTL)<br>@@ -808,7 +802,10 @@<br> struct vmtotal vmtotal;<br> struct timeval boottime;<br> time_t now;<br>- int mib[2], pagesize, usedswap = 0;<br>+ int mib[2], pagesize;<br>+#if defined(HAVE_SWAPCTL)<br>+ int usedswap = 0;<br>+#endif<br> size_t len;<br> #endif<br> <br>@@ -868,8 +865,10 @@<br> sysctl(mib, 2, &vmtotal, &len, NULL, 0);<br> freeram = (vmtotal.t_free << pageshift);<br> /* generate swap usage and totals */<br>+#if defined(HAVE_SWAPCTL)<br> swapmode(&usedswap, &totalswap);<br> freeswap = (totalswap - usedswap);<br>+#endif<br> /* grab number of processes */<br> #if defined(__OpenBSD__)<br> mib[0] = CTL_KERN;<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8071">change 8071</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8071"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: If77c39bc75f0b83a6c8a24ecb2fa69be8846160a </div>
<div style="display:none"> Gerrit-Change-Number: 8071 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>