summaryrefslogtreecommitdiff
path: root/main/logger.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2010-05-26 21:17:46 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2010-05-26 21:17:46 +0000
commitfb80119b87efc5ca0e8ee439ef70149601f4f24a (patch)
tree7297c57218c0449f310d16e934adeacf9c9f30a1 /main/logger.c
parent70a1bf31425daaa003c29af08f400f8df0623712 (diff)
Merged revisions 266142 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r266142 | tilghman | 2010-05-26 16:11:44 -0500 (Wed, 26 May 2010) | 14 lines Use sigaction for signals which should persist past the initial trigger, not signal. If you call signal() in a Solaris signal handler, instead of just resetting the signal handler, it causes the signal to refire, because the signal is not marked as handled prior to the signal handler being called. This effectively causes Solaris to immediately exceed the threadstack in recursive signal handlers and crash. (closes issue #17000) Reported by: rmcgilvr Patches: 20100526__issue17000.diff.txt uploaded by tilghman (license 14) Tested by: rmcgilvr ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/logger.c')
-rw-r--r--main/logger.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/main/logger.c b/main/logger.c
index 698e782eb..fa57a0563 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -738,7 +738,7 @@ static char *handle_logger_show_channels(struct ast_cli_entry *e, int cmd, struc
}
AST_RWLIST_UNLOCK(&logchannels);
ast_cli(a->fd, "\n");
-
+
return CLI_SUCCESS;
}
@@ -756,13 +756,16 @@ static struct ast_cli_entry cli_logger[] = {
AST_CLI_DEFINE(handle_logger_set_level, "Enables/Disables a specific logging level for this console")
};
-static int handle_SIGXFSZ(int sig)
+static void _handle_SIGXFSZ(int sig)
{
/* Indicate need to reload */
filesize_reload_needed = 1;
- return 0;
}
+static struct sigaction handle_SIGXFSZ = {
+ .sa_handler = _handle_SIGXFSZ,
+};
+
static void ast_log_vsyslog(struct logmsg *msg)
{
char buf[BUFSIZ];
@@ -929,7 +932,7 @@ int init_logger(void)
int res = 0;
/* auto rotate if sig SIGXFSZ comes a-knockin */
- (void) signal(SIGXFSZ, (void *) handle_SIGXFSZ);
+ sigaction(SIGXFSZ, &handle_SIGXFSZ, NULL);
/* start logger thread */
ast_cond_init(&logcond, NULL);