bind-dyndb-ldap/bind-dyndb-ldap-11.6-bind-9.16.13-rwlock.patch
2021-03-26 16:25:59 +01:00

66 lines
1.9 KiB
Diff

From 1d03c1e5b2e6c932c3a773518a0224d6bcd9d28b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
Date: Fri, 26 Mar 2021 11:46:26 +0100
Subject: [PATCH 2/2] rwlock initialization does not return value
API has changed, it no longer returns a value in isc_rwlock_init.
It returned always ISC_SUCCCESS on 9.16 anyway, so skip the check
on every 9.16 build.
---
src/fwd_register.c | 5 +++++
src/zone_register.c | 6 ++++++
2 files changed, 11 insertions(+)
diff --git a/src/fwd_register.c b/src/fwd_register.c
index cc9764bdf..fcbd66fd7 100644
--- a/src/fwd_register.c
+++ b/src/fwd_register.c
@@ -6,6 +6,7 @@
#include <isc/util.h>
#include <dns/name.h>
+#include "config.h"
#include "rbt_helper.h"
#include "fwd_register.h"
#include "util.h"
@@ -35,7 +36,11 @@ fwdr_create(isc_mem_t *mctx, fwd_register_t **fwdrp)
ZERO_PTR(fwdr);
isc_mem_attach(mctx, &fwdr->mctx);
CHECK(dns_rbt_create(mctx, NULL, NULL, &fwdr->rbt));
+#if LIBDNS_VERSION_MAJOR >= 1600
+ (void)isc_rwlock_init(&fwdr->rwlock, 0, 0);
+#else
CHECK(isc_rwlock_init(&fwdr->rwlock, 0, 0));
+#endif
*fwdrp = fwdr;
return ISC_R_SUCCESS;
diff --git a/src/zone_register.c b/src/zone_register.c
index 07b1546d6..28d9b7ae8 100644
--- a/src/zone_register.c
+++ b/src/zone_register.c
@@ -12,6 +12,7 @@
#include <dns/result.h>
#include <dns/zone.h>
+#include "config.h"
#include "fs.h"
#include "ldap_driver.h"
#include "log.h"
@@ -115,7 +116,12 @@ zr_create(isc_mem_t *mctx, ldap_instance_t *ldap_inst,
ZERO_PTR(zr);
isc_mem_attach(mctx, &zr->mctx);
CHECK(dns_rbt_create(mctx, delete_zone_info, mctx, &zr->rbt));
+#if LIBDNS_VERSION_MAJOR >= 1600
+ /* Never fails on BIND 9.16, even it if returns value */
+ (void)isc_rwlock_init(&zr->rwlock, 0, 0);
+#else
CHECK(isc_rwlock_init(&zr->rwlock, 0, 0));
+#endif
zr->global_settings = glob_settings;
zr->ldap_inst = ldap_inst;
--
2.26.2