From: antirez <antirez@gmail.com>
Date: Fri, 3 Sep 2010 08:24:18 +0000 (+0200)
Subject: added some comment and changed coding style for fix for 237
X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/556bdfbab9062d472e19d882ae045fece36a25ab?ds=inline;hp=--cc

added some comment and changed coding style for fix for 237
---

556bdfbab9062d472e19d882ae045fece36a25ab
diff --git a/src/vm.c b/src/vm.c
index 635016b8..ee831fb9 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -110,9 +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);
-    if(!stacksize) {
-        stacksize = 1;
-    }
+
+    /* 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 */