<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7517">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Sean Bright: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">CLI: Fix 'core show sysinfo' function ordering.<br><br>Handle CLI initialization before any processing occurs.<br><br>Change-Id: I598b911d2e409214bbdfd0ba0882be1d602d221c<br>---<br>M main/asterisk.c<br>1 file changed, 21 insertions(+), 17 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/asterisk.c b/main/asterisk.c<br>index 7edf66f..2e06f19 100644<br>--- a/main/asterisk.c<br>+++ b/main/asterisk.c<br>@@ -801,6 +801,27 @@<br> int totalswap = 0;<br> #if defined(HAVE_SYSINFO)<br> struct sysinfo sys_info;<br>+#elif defined(HAVE_SYSCTL)<br>+ static int pageshift;<br>+ struct vmtotal vmtotal;<br>+ struct timeval boottime;<br>+ time_t now;<br>+ int mib[2], pagesize, usedswap = 0;<br>+ size_t len;<br>+#endif<br>+<br>+ switch (cmd) {<br>+ case CLI_INIT:<br>+ e->command = "core show sysinfo";<br>+ e->usage =<br>+ "Usage: core show sysinfo\n"<br>+ " List current system information.\n";<br>+ return NULL;<br>+ case CLI_GENERATE:<br>+ return NULL;<br>+ }<br>+<br>+#if defined(HAVE_SYSINFO)<br> sysinfo(&sys_info);<br> uptime = sys_info.uptime / 3600;<br> physmem = sys_info.totalram * sys_info.mem_unit;<br>@@ -809,12 +830,6 @@<br> freeswap = (sys_info.freeswap * sys_info.mem_unit) / 1024;<br> nprocs = sys_info.procs;<br> #elif defined(HAVE_SYSCTL)<br>- static int pageshift;<br>- struct vmtotal vmtotal;<br>- struct timeval boottime;<br>- time_t now;<br>- int mib[2], pagesize, usedswap = 0;<br>- size_t len;<br> /* calculate the uptime by looking at boottime */<br> time(&now);<br> mib[0] = CTL_KERN;<br>@@ -861,17 +876,6 @@<br> sysctl(mib, 2, &nprocs, &len, NULL, 0);<br> #endif<br> #endif<br>-<br>- switch (cmd) {<br>- case CLI_INIT:<br>- e->command = "core show sysinfo";<br>- e->usage =<br>- "Usage: core show sysinfo\n"<br>- " List current system information.\n";<br>- return NULL;<br>- case CLI_GENERATE:<br>- return NULL;<br>- }<br> <br> ast_cli(a->fd, "\nSystem Statistics\n");<br> ast_cli(a->fd, "-----------------\n");<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7517">change 7517</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/7517"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I598b911d2e409214bbdfd0ba0882be1d602d221c </div>
<div style="display:none"> Gerrit-Change-Number: 7517 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>