diff options
author | Paul Lindner <plindner@hi5.com> | 2007-08-06 17:58:40 +0000 |
---|---|---|
committer | Paul Lindner <plindner@hi5.com> | 2007-08-06 17:58:40 +0000 |
commit | 9fd057207a5f0aa9595e89bd43e2a5134dff653e (patch) | |
tree | 6c88000e91727dfce81f6a7f91ca2709fa067386 | |
parent | 70960eb3c1247b10331b29410522371949004c1a (diff) | |
download | memcached-9fd057207a5f0aa9595e89bd43e2a5134dff653e.tar.gz |
Workaround crash when using -P and -d flags on x86_64 with latest libevent release.
git-svn-id: http://code.sixapart.com/svn/memcached/trunk/server@604 b0b603af-a30f-0410-a34e-baf09ae79d0b
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | memcached.c | 7 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,7 @@ +2007-08-06 Paul Lindner <lindner@inuus.com> + * Fix crash when using -P and -d flags on x86_64 + with latest libevent release. + 2007-07-08 Steven Grimm <sgrimm@facebook.com> * Item stats commands weren't thread-safe; wrap them with locks diff --git a/memcached.c b/memcached.c index ea474a6..10f3bcc 100644 --- a/memcached.c +++ b/memcached.c @@ -2697,11 +2697,12 @@ int main (int argc, char **argv) { fprintf(stderr, "failed to create listening connection"); exit(EXIT_FAILURE); } - /* save the PID in if we're a daemon */ - if (daemonize) - save_pid(getpid(), pid_file); /* 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); /* initialise clock event */ clock_handler(0, 0, 0); /* initialise deletion array and timer event */ |