Author: anthm Date: Sat Mar 7 08:07:48 2009 New Revision: 12509 Log: FSCORE-323 Modified: freeswitch/trunk/src/switch.c Modified: freeswitch/trunk/src/switch.c ============================================================================== --- freeswitch/trunk/src/switch.c (original) +++ freeswitch/trunk/src/switch.c Sat Mar 7 08:07:48 2009 @@ -621,13 +621,23 @@ memset(&rlp, 0, sizeof(rlp)); getrlimit(RLIMIT_STACK, &rlp); if (rlp.rlim_max > SWITCH_THREAD_STACKSIZE) { + char buf[1024] = ""; + int i = 0; memset(&rlp, 0, sizeof(rlp)); rlp.rlim_cur = SWITCH_THREAD_STACKSIZE; rlp.rlim_max = SWITCH_THREAD_STACKSIZE; setrlimit(RLIMIT_STACK, &rlp); - fprintf(stderr, "Error: stacksize %d is too large: run ulimit -s %d or run %s -waste.\nauto-adjusting stack size for optimal performance....\n", - SWITCH_THREAD_STACKSIZE / 1024, SWITCH_THREAD_STACKSIZE / 1024, argv[0]); - return (int)execv(argv[0], argv); + fprintf(stderr, "Error: stacksize %ld is too large: run ulimit -s %d or run %s -waste.\nauto-adjusting stack size for optimal performance....\n", + rlp.rlim_max / 1024, SWITCH_THREAD_STACKSIZE / 1024, argv[0]); + apr_terminate(); + ret = (int)execv(argv[0], argv); + + for(i = 0; i < argc; i++) { + switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "%s ", argv[i]); + } + + return system(buf); + } } #endif