<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10646">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">core: Fix handling of restart from remote console.<br><br>We cannot use need_el_end and SIGURG when restarting. Instead we need<br>to run el_end within the SIGHUP restartnow handler.<br><br>ASTERISK-28158<br><br>Change-Id: Ia852276363c81bdcf1aa29eb4558c5c2fa1218a0<br>---<br>M main/asterisk.c<br>1 file changed, 11 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/46/10646/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/asterisk.c b/main/asterisk.c</span><br><span>index 174f9f7..edb3a22 100644</span><br><span>--- a/main/asterisk.c</span><br><span>+++ b/main/asterisk.c</span><br><span>@@ -1791,10 +1791,17 @@</span><br><span> </span><br><span> static void _hup_handler(int num)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- int a = 0, save_errno = errno;</span><br><span style="color: hsl(0, 100%, 40%);">- printf("Received HUP signal -- Reloading configs\n");</span><br><span style="color: hsl(0, 100%, 40%);">- if (restartnow)</span><br><span style="color: hsl(120, 100%, 40%);">+ int a = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ int save_errno = errno;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ if (restartnow) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (el) {</span><br><span style="color: hsl(120, 100%, 40%);">+ el_end(el);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> execvp(_argv[0], _argv);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ printf("Received HUP signal -- Reloading configs\n");</span><br><span> sig_flags.need_reload = 1;</span><br><span> if (sig_alert_pipe[1] != -1) {</span><br><span> if (write(sig_alert_pipe[1], &a, sizeof(a)) < 0) {</span><br><span>@@ -2137,7 +2144,7 @@</span><br><span> if (el_hist != NULL) {</span><br><span> history_end(el_hist);</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(120, 100%, 40%);">+ } else if (!restart) {</span><br><span> sig_flags.need_el_end = 1;</span><br><span> pthread_kill(consolethread, SIGURG);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10646">change 10646</a>. To unsubscribe, or for help writing mail filters, 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/10646"/><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: Ia852276363c81bdcf1aa29eb4558c5c2fa1218a0 </div>
<div style="display:none"> Gerrit-Change-Number: 10646 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>