]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
use trylock in badcache
authorWitold Kręcicki <wpk@isc.org>
Wed, 13 Nov 2019 12:13:53 +0000 (13:13 +0100)
committerWitold Kręcicki <wpk@isc.org>
Wed, 13 Nov 2019 12:13:53 +0000 (13:13 +0100)
lib/dns/badcache.c

index 389981f8498038330deaa91ea7a3db34063050f2..f818629067369786e9fa42ec7f87cae2cb95e669 100644 (file)
@@ -216,7 +216,9 @@ dns_badcache_find(dns_badcache_t *bc, const dns_name_t *name,
        REQUIRE(name != NULL);
        REQUIRE(now != NULL);
 
-       LOCK(&bc->lock);
+       if (isc_mutex_trylock(&bc->lock) != ISC_R_SUCCESS) {
+               return (false);
+       }
 
        /*
         * XXXMUKS: dns_name_equal() is expensive as it does a