From 5e409a8e7545deff27890b546c3fd7932fe2d6f3 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Wed, 9 May 2007 09:55:30 +0000 Subject: [PATCH] Compiletest fix alloc.c git-svn-id: file:///svn/unbound/trunk@302 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 2 ++ util/alloc.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/Changelog b/doc/Changelog index c549f518f..bd078e041 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,8 @@ - tpkg test for retry in TCP mode, against ldns-testns server. - daemon checks max number of open files and complains if not enough. - test where data expires in the cache. + - compiletests: fixed empty body ifstatements in alloc.c, in case + locks are disabled. 8 May 2007: Wouter - outgoing network keeps list of available tcp buffers for outgoing diff --git a/util/alloc.c b/util/alloc.c index 5ba9a725c..3e25fbde8 100644 --- a/util/alloc.c +++ b/util/alloc.c @@ -208,8 +208,9 @@ alloc_special_release(struct alloc_cache* alloc, alloc_special_t* mem) log_assert(alloc); if(!mem) return; - if(!alloc->super) /* superalloc needs locking */ - lock_quick_lock(&alloc->lock); + if(!alloc->super) { + lock_quick_lock(&alloc->lock); /* superalloc needs locking */ + } alloc_special_clean(mem); if(alloc->super && alloc->num_quar >= ALLOC_SPECIAL_MAX) { @@ -221,8 +222,9 @@ alloc_special_release(struct alloc_cache* alloc, alloc_special_t* mem) alloc_set_special_next(mem, alloc->quar); alloc->quar = mem; alloc->num_quar++; - if(!alloc->super) + if(!alloc->super) { lock_quick_unlock(&alloc->lock); + } } void -- 2.47.2