[Freeswitch-svn] [commit] r9817 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Fri Oct 3 17:30:05 EDT 2008


Author: mikej
Date: Fri Oct  3 17:30:04 2008
New Revision: 9817

Modified:
   freeswitch/trunk/src/switch_core.c

Log:
FSCORE-197 unprivileged user setting bigger stack for switch_system thread failure

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Fri Oct  3 17:30:04 2008
@@ -758,7 +758,7 @@
 #ifndef __FreeBSD__
 	memset(&rlp, 0, sizeof(rlp));
 	rlp.rlim_cur = SWITCH_THREAD_STACKSIZE;
-	rlp.rlim_max = SWITCH_THREAD_STACKSIZE;
+	rlp.rlim_max = SWITCH_SYSTEM_THREAD_STACKSIZE;
 	setrlimit(RLIMIT_STACK, &rlp);
 #endif
 
@@ -1512,7 +1512,9 @@
 
 	rlim.rlim_cur = SWITCH_SYSTEM_THREAD_STACKSIZE;
 	rlim.rlim_max = SWITCH_SYSTEM_THREAD_STACKSIZE;
-	setrlimit(RLIMIT_STACK, &rlim);
+	if (setrlimit(RLIMIT_STACK, &rlim) < 0) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Setting stack size failed!\n");
+	}
 #endif
 
 	if (switch_core_new_memory_pool(&pool) != SWITCH_STATUS_SUCCESS) {



More information about the Freeswitch-svn mailing list