summaryrefslogtreecommitdiff
blob: 20646abb75b8b101e8f098064b32e793a877498a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
http://lists.danga.com/pipermail/memcached/2007-October/005415.html
http://bugs.gentoo.org/show_bug.cgi?id=195248 
Index: /trunk/server/memcached.c
===================================================================
--- /trunk/server/memcached.c (revision 595)
+++ /trunk/server/memcached.c (revision 604)
@@ -2698,9 +2698,10 @@
         exit(EXIT_FAILURE);
     }
-    /* save the PID in if we're a daemon */
+    /* start up worker threads if MT mode */
+    thread_init(settings.num_threads, main_base);
+    /* save the PID in if we're a daemon, do this after thread_init due to
+       a file descriptor handling bug somewhere in libevent */
     if (daemonize)
         save_pid(getpid(), pid_file);
-    /* start up worker threads if MT mode */
-    thread_init(settings.num_threads, main_base);
     /* initialise clock event */
     clock_handler(0, 0, 0);