aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-01 02:47:19 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-01 02:47:19 +0000
commit221763ce1a733fe2a2a3818f5ee82ac9df643877 (patch)
tree18d0b78596848a8d31b8b3e1943db521558be06e /asterisk.c
parentc8c98c2ede89b4c467f30cd62b685ac9768bbf32 (diff)
Add ${TIMESTAMP} (bug #607) and don't ever ast_log from within handler
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1805 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/asterisk.c b/asterisk.c
index 8e64773f6..37efe8029 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -333,8 +333,9 @@ static void urg_handler(int num)
{
/* Called by soft_hangup to interrupt the select, read, or other
system call. We don't actually need to do anything though. */
+ /* Cannot EVER ast_log from within a signal handler */
if (option_debug)
- ast_log(LOG_DEBUG, "Urgent handler\n");
+ printf("Urgent handler\n");
signal(num, urg_handler);
return;
}
@@ -342,12 +343,14 @@ static void urg_handler(int num)
static void hup_handler(int num)
{
if (option_verbose > 1)
- ast_verbose(VERBOSE_PREFIX_2 "Received HUP signal -- Reloading configs\n");
+ printf("Received HUP signal -- Reloading configs\n");
+ /* XXX This could deadlock XXX */
ast_module_reload();
}
static void child_handler(int sig)
{
+ /* Must not ever ast_log or ast_verbose within signal handler */
int n, status;
/*
@@ -356,7 +359,7 @@ static void child_handler(int sig)
for (n = 0; wait4(-1, &status, WNOHANG, NULL) > 0; n++)
;
if (n == 0 && option_debug)
- ast_log(LOG_DEBUG, "Huh? Child handler, but nobody there?\n");
+ printf("Huh? Child handler, but nobody there?\n");
}
static void set_title(char *text)