<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10647">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, 9 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/47/10647/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 12e6255..cf50b3f 100644</span><br><span>--- a/main/asterisk.c</span><br><span>+++ b/main/asterisk.c</span><br><span>@@ -1673,9 +1673,15 @@</span><br><span> static void _hup_handler(int num)</span><br><span> {</span><br><span>       int 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%);">+</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 (ast_alertpipe_write(sig_alert_pipe)) {</span><br><span>           fprintf(stderr, "hup_handler: write() failed: %s\n", strerror(errno));</span><br><span>@@ -2016,7 +2022,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/10647">change 10647</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/10647"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </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: 10647 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>