| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Memcached
Revision: 783
Author: dormando
Date: 11 Jun 2008 23:36:09
Changes:make -k work under daemon mode (-d).
Files:| ... | ...@@ -1,3 +1,7 @@ | |
| 1 | 2008-06-11 | |
| 2 | ||
| 3 | * Fix -k to work with -d. (reported by Gary Zhu) | |
| 4 | ||
| 1 | 5 | 2008-03-02 [Version 1.2.5-rc1 released] |
| 2 | 6 | |
| 3 | 7 | * Add per-item-class tracking of evictions and OOM errors (dormando) |
| ... | ...@@ -3004,6 +3004,17 @@ | |
| 3004 | 3004 | } |
| 3005 | 3005 | } |
| 3006 | 3006 | |
| 3007 | /* daemonize if requested */ | |
| 3008 | /* if we want to ensure our ability to dump core, don't chdir to / */ | |
| 3009 | if (daemonize) { | |
| 3010 | int res; | |
| 3011 | res = daemon(maxcore, settings.verbose); | |
| 3012 | if (res == -1) { | |
| 3013 | fprintf(stderr, "failed to daemon() in order to daemonize\n"); | |
| 3014 | return 1; | |
| 3015 | } | |
| 3016 | } | |
| 3017 | ||
| 3007 | 3018 | /* lock paged memory if needed */ |
| 3008 | 3019 | if (lock_memory) { |
| 3009 | 3020 | #ifdef HAVE_MLOCKALL |
| ... | ...@@ -3033,18 +3044,6 @@ | |
| 3033 | 3044 | } |
| 3034 | 3045 | } |
| 3035 | 3046 | |
| 3036 | /* daemonize if requested */ | |
| 3037 | /* if we want to ensure our ability to dump core, don't chdir to / */ | |
| 3038 | if (daemonize) { | |
| 3039 | int res; | |
| 3040 | res = daemon(maxcore, settings.verbose); | |
| 3041 | if (res == -1) { | |
| 3042 | fprintf(stderr, "failed to daemon() in order to daemonize\n"); | |
| 3043 | return 1; | |
| 3044 | } | |
| 3045 | } | |
| 3046 | ||
| 3047 | ||
| 3048 | 3047 | /* initialize main thread libevent instance */ |
| 3049 | 3048 | main_base = event_init(); |
| 3050 | 3049 |