Merge "core: Fix handling of restart from remote console." into 16

This commit is contained in:
George Joseph 2018-11-16 09:22:36 -06:00 committed by Gerrit Code Review
commit ccf38b3e34
1 changed files with 9 additions and 3 deletions

View File

@ -1673,9 +1673,15 @@ static struct sigaction urg_handler = {
static void _hup_handler(int num)
{
int save_errno = errno;
printf("Received HUP signal -- Reloading configs\n");
if (restartnow)
if (restartnow) {
if (el) {
el_end(el);
}
execvp(_argv[0], _argv);
}
printf("Received HUP signal -- Reloading configs\n");
sig_flags.need_reload = 1;
if (ast_alertpipe_write(sig_alert_pipe)) {
fprintf(stderr, "hup_handler: write() failed: %s\n", strerror(errno));
@ -2016,7 +2022,7 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart)
if (el_hist != NULL) {
history_end(el_hist);
}
} else {
} else if (!restart) {
sig_flags.need_el_end = 1;
pthread_kill(consolethread, SIGURG);
}