[Asterisk-code-review] core: Fix handling of restart from remote console. (asterisk[13])
Corey Farrell
asteriskteam at digium.com
Thu Nov 15 05:28:09 CST 2018
Corey Farrell has uploaded this change for review. ( https://gerrit.asterisk.org/10646
Change subject: core: Fix handling of restart from remote console.
......................................................................
core: Fix handling of restart from remote console.
We cannot use need_el_end and SIGURG when restarting. Instead we need
to run el_end within the SIGHUP restartnow handler.
ASTERISK-28158
Change-Id: Ia852276363c81bdcf1aa29eb4558c5c2fa1218a0
---
M main/asterisk.c
1 file changed, 11 insertions(+), 4 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/46/10646/1
diff --git a/main/asterisk.c b/main/asterisk.c
index 174f9f7..edb3a22 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -1791,10 +1791,17 @@
static void _hup_handler(int num)
{
- int a = 0, save_errno = errno;
- printf("Received HUP signal -- Reloading configs\n");
- if (restartnow)
+ int a = 0;
+ int save_errno = errno;
+
+ if (restartnow) {
+ if (el) {
+ el_end(el);
+ }
execvp(_argv[0], _argv);
+ }
+
+ printf("Received HUP signal -- Reloading configs\n");
sig_flags.need_reload = 1;
if (sig_alert_pipe[1] != -1) {
if (write(sig_alert_pipe[1], &a, sizeof(a)) < 0) {
@@ -2137,7 +2144,7 @@
if (el_hist != NULL) {
history_end(el_hist);
}
- } else {
+ } else if (!restart) {
sig_flags.need_el_end = 1;
pthread_kill(consolethread, SIGURG);
}
--
To view, visit https://gerrit.asterisk.org/10646
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia852276363c81bdcf1aa29eb4558c5c2fa1218a0
Gerrit-Change-Number: 10646
Gerrit-PatchSet: 1
Gerrit-Owner: Corey Farrell <git at cfware.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181115/97f7c2ba/attachment.html>
More information about the asterisk-code-review
mailing list