]> git.saurik.com Git - redis.git/blobdiff - src/vm.c
Merge remote branch 'pietern/ziplist-eff'
[redis.git] / src / vm.c
index 50fb326dba12ce90dbe817adc5a3661f538807b7..ee831fb9a3407dfc7f026f70e8d16dd437a737b0 100644 (file)
--- a/src/vm.c
+++ b/src/vm.c
@@ -110,6 +110,11 @@ void vmInit(void) {
     /* LZF requires a lot of stack */
     pthread_attr_init(&server.io_threads_attr);
     pthread_attr_getstacksize(&server.io_threads_attr, &stacksize);
+
+    /* Solaris may report a stacksize of 0, let's set it to 1 otherwise
+     * multiplying it by 2 in the while loop later will not really help ;) */
+    if (!stacksize) stacksize = 1;
+
     while (stacksize < REDIS_THREAD_STACK_SIZE) stacksize *= 2;
     pthread_attr_setstacksize(&server.io_threads_attr, stacksize);
     /* Listen for events in the threaded I/O pipe */