mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
Bug 6156 - catch all threading errors, not just simple failure
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -289,10 +289,11 @@ static void launch_service(struct outgoing *o)
|
|||||||
{
|
{
|
||||||
pthread_t t;
|
pthread_t t;
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
|
int ret;
|
||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||||
if (ast_pthread_create(&t,&attr,attempt_thread, o) == -1) {
|
if ((ret = ast_pthread_create(&t,&attr,attempt_thread, o)) != 0) {
|
||||||
ast_log(LOG_WARNING, "Unable to create thread :(\n");
|
ast_log(LOG_WARNING, "Unable to create thread :( (returned error: %d)\n", ret);
|
||||||
free_outgoing(o);
|
free_outgoing(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -413,6 +414,7 @@ int load_module(void)
|
|||||||
{
|
{
|
||||||
pthread_t thread;
|
pthread_t thread;
|
||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
|
int ret;
|
||||||
snprintf(qdir, sizeof(qdir), "%s/%s", ast_config_AST_SPOOL_DIR, "outgoing");
|
snprintf(qdir, sizeof(qdir), "%s/%s", ast_config_AST_SPOOL_DIR, "outgoing");
|
||||||
if (mkdir(qdir, 0700) && (errno != EEXIST)) {
|
if (mkdir(qdir, 0700) && (errno != EEXIST)) {
|
||||||
ast_log(LOG_WARNING, "Unable to create queue directory %s -- outgoing spool disabled\n", qdir);
|
ast_log(LOG_WARNING, "Unable to create queue directory %s -- outgoing spool disabled\n", qdir);
|
||||||
@@ -420,8 +422,8 @@ int load_module(void)
|
|||||||
}
|
}
|
||||||
pthread_attr_init(&attr);
|
pthread_attr_init(&attr);
|
||||||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||||
if (ast_pthread_create(&thread,&attr,scan_thread, NULL) == -1) {
|
if ((ret = ast_pthread_create(&thread,&attr,scan_thread, NULL)) != 0) {
|
||||||
ast_log(LOG_WARNING, "Unable to create thread :(\n");
|
ast_log(LOG_WARNING, "Unable to create thread :( (returned error: %d)\n", ret);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user