summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Sallings <dustin@spy.net>2009-03-30 08:31:51 -0700
committerDustin Sallings <dustin@spy.net>2009-03-30 14:11:07 -0700
commit0bdda0d73c11a6ed638921a6690214c77a304a9c (patch)
tree26f3de69c7771f8b7ae5adc4a981f74d0678675e
parent3d540bdbe423c674dba899266d3d678e2b19c47e (diff)
downloadmemcached-0bdda0d73c11a6ed638921a6690214c77a304a9c.tar.gz
Use a bool for the accepting_conns stat.
-rw-r--r--memcached.c6
-rw-r--r--memcached.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/memcached.c b/memcached.c
index 12322de..8205da9 100644
--- a/memcached.c
+++ b/memcached.c
@@ -161,7 +161,7 @@ static void stats_init(void) {
stats.curr_items = stats.total_items = stats.curr_conns = stats.total_conns = stats.conn_structs = 0;
stats.get_cmds = stats.set_cmds = stats.get_hits = stats.get_misses = stats.evictions = 0;
stats.curr_bytes = stats.listen_disabled_num = 0;
- stats.accepting_conns = 1; /* assuming we start in this state. */
+ stats.accepting_conns = true; /* assuming we start in this state. */
/* make the time we started always be 2 seconds before we really
did, so time(0) - time.started is never zero. if so, things
@@ -3248,11 +3248,11 @@ void accept_new_conns(const bool do_accept) {
if (do_accept) {
STATS_LOCK();
- stats.accepting_conns = 1;
+ stats.accepting_conns = true;
STATS_UNLOCK();
} else {
STATS_LOCK();
- stats.accepting_conns = 0;
+ stats.accepting_conns = false;
stats.listen_disabled_num++;
STATS_UNLOCK();
}
diff --git a/memcached.h b/memcached.h
index 3ca2eef..20a145e 100644
--- a/memcached.h
+++ b/memcached.h
@@ -109,7 +109,7 @@ struct stats {
uint64_t get_misses;
uint64_t evictions;
time_t started; /* when the process was started */
- unsigned int accepting_conns; /* whether we are currently accepting */
+ bool accepting_conns; /* whether we are currently accepting */
uint64_t listen_disabled_num;
};