[svn-commits] branch 1.2 - r7848 /branches/1.2/pbx/pbx_spool.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Jan 7 01:27:19 CST 2006


Author: tilghman
Date: Sat Jan  7 01:27:18 2006
New Revision: 7848

URL: http://svn.digium.com/view/asterisk?rev=7848&view=rev
Log:
Bug 6156 - catch all threading errors, not just simple failure

Modified:
    branches/1.2/pbx/pbx_spool.c

Modified: branches/1.2/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/pbx/pbx_spool.c?rev=7848&r1=7847&r2=7848&view=diff
==============================================================================
--- branches/1.2/pbx/pbx_spool.c (original)
+++ branches/1.2/pbx/pbx_spool.c Sat Jan  7 01:27:18 2006
@@ -289,10 +289,11 @@
 {
 	pthread_t t;
 	pthread_attr_t attr;
+	int ret;
 	pthread_attr_init(&attr);
  	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-	if (ast_pthread_create(&t,&attr,attempt_thread, o) == -1) {
-		ast_log(LOG_WARNING, "Unable to create thread :(\n");
+	if ((ret = ast_pthread_create(&t,&attr,attempt_thread, o)) != 0) {
+		ast_log(LOG_WARNING, "Unable to create thread :( (returned error: %d)\n", ret);
 		free_outgoing(o);
 	}
 }
@@ -413,6 +414,7 @@
 {
 	pthread_t thread;
 	pthread_attr_t attr;
+	int ret;
 	snprintf(qdir, sizeof(qdir), "%s/%s", ast_config_AST_SPOOL_DIR, "outgoing");
 	if (mkdir(qdir, 0700) && (errno != EEXIST)) {
 		ast_log(LOG_WARNING, "Unable to create queue directory %s -- outgoing spool disabled\n", qdir);
@@ -420,8 +422,8 @@
 	}
 	pthread_attr_init(&attr);
  	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-	if (ast_pthread_create(&thread,&attr,scan_thread, NULL) == -1) {
-		ast_log(LOG_WARNING, "Unable to create thread :(\n");
+	if ((ret = ast_pthread_create(&thread,&attr,scan_thread, NULL)) != 0) {
+		ast_log(LOG_WARNING, "Unable to create thread :( (returned error: %d)\n", ret);
 		return -1;
 	}
 	return 0;



More information about the svn-commits mailing list