automerge commit

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@52949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Automerge Script
2007-01-30 18:14:52 +00:00
parent 20b69b892a
commit 1308ebf409

View File

@@ -234,6 +234,8 @@ static int shuttingdown = 0;
static int restartnow = 0; static int restartnow = 0;
static pthread_t consolethread = AST_PTHREADT_NULL; static pthread_t consolethread = AST_PTHREADT_NULL;
static unsigned int need_reload;
#if !defined(LOW_MEMORY) #if !defined(LOW_MEMORY)
struct file_version { struct file_version {
AST_LIST_ENTRY(file_version) list; AST_LIST_ENTRY(file_version) list;
@@ -747,8 +749,7 @@ static void hup_handler(int num)
printf("Received HUP signal -- Reloading configs\n"); printf("Received HUP signal -- Reloading configs\n");
if (restartnow) if (restartnow)
execvp(_argv[0], _argv); execvp(_argv[0], _argv);
/* XXX This could deadlock XXX */ need_reload = 1;
ast_module_reload(NULL);
signal(num, hup_handler); signal(num, hup_handler);
} }
@@ -1816,6 +1817,11 @@ static void ast_remotecontrol(char * data)
} }
} }
} }
if (need_reload) {
need_reload = 0;
ast_module_reload(NULL);
}
} }
printf("\nDisconnected from Asterisk server\n"); printf("\nDisconnected from Asterisk server\n");
} }
@@ -2433,13 +2439,21 @@ int main(int argc, char *argv[])
break; break;
} }
} }
if (need_reload) {
need_reload = 0;
ast_module_reload(NULL);
}
} }
} }
/* Do nothing */ /* Do nothing */
for(;;) { /* apparently needed for the MACos */ for(;;) { /* apparently needed for the MACos */
struct pollfd p = { -1 /* no descriptor */, 0, 0 }; struct pollfd p = { -1 /* no descriptor */, 0, 0 };
poll(&p, 0, -1); poll(&p, 0, -1);
/* SIGHUP will cause this to break out of poll() */
if (need_reload) {
need_reload = 0;
ast_module_reload(NULL);
}
} }
return 0; return 0;
} }