]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3720. [bug] Address compiler warnings. [RT #35261]
authorMark Andrews <marka@isc.org>
Wed, 29 Jan 2014 23:33:28 +0000 (10:33 +1100)
committerMark Andrews <marka@isc.org>
Wed, 29 Jan 2014 23:33:28 +0000 (10:33 +1100)
CHANGES
bin/tests/log_test.c
lib/dns/include/dns/rbt.h

diff --git a/CHANGES b/CHANGES
index db812b5db34997d23673b7658d241035a88ec82b..fe433dc2e0ce4949691deecc83554373e4ca4b70 100644 (file)
--- 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]
index 95d1953e2aac911e63a4dfddaba30cad6c88cf4b..58b3684d85249e057f3481a6a12b85d2d2870732 100644 (file)
@@ -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)
index 9158be6e2a741e896f7d81007b4e45acc473c01f..8026030527b12c27eaf61fa0cc68977a1bd8fdaf 100644 (file)
@@ -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