summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2011-03-18 10:53:00 -0700
committerTrond Norbye <trond.norbye@gmail.com>2011-03-18 11:03:12 -0700
commit458d1e1986f53e65d84007e9f99da993607b027d (patch)
tree3ddaa69658a6f6da94ba687134e45b4c99c38d00
parentcb195a7fd1081032a0dd58e411e545e22bf9af72 (diff)
downloadmemcached-458d1e1986f53e65d84007e9f99da993607b027d.tar.gz
Initialize process start time before set_current_time()
Time is relative, memcached time doubly so. set_current_time() sets the time relative to the start time, which we didn't know until stats initialization. Mass confusion from doing this wrong.
-rw-r--r--daemon/memcached.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/daemon/memcached.c b/daemon/memcached.c
index b67a64c..6ee8802 100644
--- a/daemon/memcached.c
+++ b/daemon/memcached.c
@@ -234,11 +234,6 @@ static void stats_init(void) {
stats.rejected_conns = 0;
stats.curr_conns = stats.total_conns = stats.conn_structs = 0;
- /* make the time we started always be 2 seconds before we really
- did, so time(0) - time.started is never zero. if so, things
- like 'settings.oldest_live' which act as booleans as well as
- values are now false in boolean context... */
- process_started = time(0) - 2;
stats_prefix_init();
}
@@ -6755,6 +6750,11 @@ int main (int argc, char **argv) {
return EX_OSERR;
}
+ /* make the time we started always be 2 seconds before we really
+ did, so time(0) - time.started is never zero. if so, things
+ like 'settings.oldest_live' which act as booleans as well as
+ values are now false in boolean context... */
+ process_started = time(0) - 2;
set_current_time();
/* Initialize the socket subsystem */