From: Mark Andrews Date: Wed, 29 Jan 2014 23:33:28 +0000 (+1100) Subject: 3720. [bug] Address compiler warnings. [RT #35261] X-Git-Tag: v9.10.0a2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63add83a2699aac4e01be6d1f2d093cfed4f744a;p=thirdparty%2Fbind9.git 3720. [bug] Address compiler warnings. [RT #35261] --- diff --git a/CHANGES b/CHANGES index db812b5db34..fe433dc2e0c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3720. [bug] Address compiler warnings. [RT #35261] + 3719. [bug] Address memory leak in in peer.c. [RT #35255] 3718. [bug] A missing ISC_LINK_INIT in log.c. [RT #35260] diff --git a/bin/tests/log_test.c b/bin/tests/log_test.c index 95d1953e2aa..58b3684d852 100644 --- a/bin/tests/log_test.c +++ b/bin/tests/log_test.c @@ -324,13 +324,26 @@ main(int argc, char **argv) { * XXXDCL NT */ fputc('\n', stderr); - system("head " TEST_FILE "*; rm -f " TEST_FILE "*"); + if (system("head " TEST_FILE "*; rm -f " TEST_FILE "*") != 0) { + fprintf(stderr, "system(\"head " TEST_FILE "*; rm -f " + TEST_FILE "*\") failed\n"); + goto cleanup; + } - freopen(syslog_file, "r", stdin); + /* This is highly system specific. */ + if (freopen(syslog_file, "r", stdin) == NULL) { + fprintf(stderr, "freopen(%s, \"r\", stdin) failed\n", + syslog_file); + goto cleanup; + } fprintf(stderr, "\n==> %s <==\n", syslog_file); - system("tail -2"); + if (system("tail -2") != 0) { + fprintf(stderr, "system(\"tail -2\") failed\n"); + goto cleanup; + } fputc('\n', stderr); + cleanup: isc_log_destroy(&lctx); if (show_final_mem) diff --git a/lib/dns/include/dns/rbt.h b/lib/dns/include/dns/rbt.h index 9158be6e2a7..8026030527b 100644 --- a/lib/dns/include/dns/rbt.h +++ b/lib/dns/include/dns/rbt.h @@ -987,6 +987,31 @@ dns_rbtnodechain_nextflat(dns_rbtnodechain_t *chain, dns_name_t *name); #define dns_rbtnode_refinit(node, n) ((node)->references = (n)) #define dns_rbtnode_refdestroy(node) REQUIRE((node)->references == 0) #define dns_rbtnode_refcurrent(node) ((node)->references) + +#if (__STDC_VERSION__ + 0) >= 199901L || defined __GNUC__ +static inline void +dns_rbtnode_refincrement0(dns_rbtnode_t *node, unsigned int *refs) { + node->references++; + if (refs != NULL) + *refs = node->references; +} + +static inline void +dns_rbtnode_refincrement(dns_rbtnode_t *node, unsigned int *refs) { + REQUIRE(node->references > 0); + node->references++; + if (refs != NULL) + *refs = node->references; +} + +static inline void +dns_rbtnode_refdecrement(dns_rbtnode_t *node, unsigned int *refs) { + REQUIRE(node->references > 0); + node->references--; + if (refs != NULL) + *refs = node->references; +} +#else #define dns_rbtnode_refincrement0(node, refs) \ do { \ unsigned int *_tmp = (unsigned int *)(refs); \ @@ -1008,6 +1033,7 @@ dns_rbtnodechain_nextflat(dns_rbtnodechain_t *chain, dns_name_t *name); if ((refs) != NULL) \ (*refs) = (node)->references; \ } while (0) +#endif #endif /* DNS_RBT_USEISCREFCOUNT */ ISC_LANG_ENDDECLS