diff --git a/src/switch.c b/src/switch.c index 3903a15604..30a6f1e7e1 100644 --- a/src/switch.c +++ b/src/switch.c @@ -793,12 +793,11 @@ int main(int argc, char *argv[]) memset(&rlp, 0, sizeof(rlp)); getrlimit(RLIMIT_STACK, &rlp); - if (rlp.rlim_max > SWITCH_THREAD_STACKSIZE) { + if (rlp.rlim_cur != SWITCH_THREAD_STACKSIZE) { char buf[1024] = ""; int i = 0; - - fprintf(stderr, "Error: stacksize %d is too large: run ulimit -s %d from your shell before starting the application.\nauto-adjusting stack size for optimal performance...\n", - (int) (rlp.rlim_max / 1024), SWITCH_THREAD_STACKSIZE / 1024); + fprintf(stderr, "Error: stacksize %d is not optimal: run ulimit -s %d from your shell before starting the application.\nauto-adjusting stack size for optimal performance...\n", + (int) (rlp.rlim_cur / 1024), SWITCH_THREAD_STACKSIZE / 1024); memset(&rlp, 0, sizeof(rlp)); rlp.rlim_cur = SWITCH_THREAD_STACKSIZE;