]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1421. [func] Differentiate updates that don't succeed due to
authorMark Andrews <marka@isc.org>
Tue, 21 Jan 2003 05:18:11 +0000 (05:18 +0000)
committerMark Andrews <marka@isc.org>
Tue, 21 Jan 2003 05:18:11 +0000 (05:18 +0000)
                        prerequisites (unsuccessful) vs other reasons
                        (failed).
developer: marka
reviews: explorer

CHANGES
bin/named/update.c

diff --git a/CHANGES b/CHANGES
index 13f707b814bc641df0a353fe91ceebfee29766a0..3329b771247dd9b5b73d7241fc361532e6d1b60f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+1421.  [func]          Differentiate updates that don't succeed due to
+                       prerequisites (unsuccessful) vs other reasons
+                       (failed).
+
 1420.  [port]          solaris: work around gcc optimiser bug.
 
 1419.  [port]          openbsd: use /dev/arandom. [RT #4950]
index 7ef9b9507adcf9399dacadb0fb52da463241b45d..f04c7a1b9f5fc5b19562ded3b4b063f2931fc447 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: update.c,v 1.104 2003/01/10 02:37:44 marka Exp $ */
+/* $Id: update.c,v 1.105 2003/01/21 05:18:11 marka Exp $ */
 
 #include <config.h>
 
  */
 #define FAILC(code, msg) \
        do {                                                    \
+               const char *_what = "failed";                   \
                result = (code);                                \
+               switch (result) {                               \
+               case DNS_R_NXDOMAIN:                            \
+               case DNS_R_YXDOMAIN:                            \
+               case DNS_R_YXRRSET:                             \
+               case DNS_R_NXRRSET:                             \
+                       _what = "unsuccessful";                 \
+               }                                               \
                update_log(client, zone, LOGLEVEL_PROTOCOL,     \
-                             "update failed: %s (%s)",         \
+                             "update %s: %s (%s)", _what,      \
                              msg, isc_result_totext(result));  \
                if (result != ISC_R_SUCCESS) goto failure;      \
        } while (0)
 
 #define FAILN(code, name, msg) \
        do {                                                            \
+               const char *_what = "failed";                           \
                result = (code);                                        \
+               switch (result) {                                       \
+               case DNS_R_NXDOMAIN:                                    \
+               case DNS_R_YXDOMAIN:                                    \
+               case DNS_R_YXRRSET:                                     \
+               case DNS_R_NXRRSET:                                     \
+                       _what = "unsuccessful";                         \
+               }                                                       \
                if (isc_log_wouldlog(ns_g_lctx, LOGLEVEL_PROTOCOL)) {   \
                        char _nbuf[DNS_NAME_FORMATSIZE];                \
                        dns_name_format(name, _nbuf, sizeof(_nbuf));    \
                        update_log(client, zone, LOGLEVEL_PROTOCOL,     \
-                                  "update failed: %s: %s (%s)", _nbuf, \
+                                  "update %s: %s: %s (%s)", _what, _nbuf, \
                                   msg, isc_result_totext(result));     \
                }                                                       \
                if (result != ISC_R_SUCCESS) goto failure;              \
 
 #define FAILNT(code, name, type, msg) \
        do {                                                            \
+               const char *_what = "failed";                           \
                result = (code);                                        \
+               switch (result) {                                       \
+               case DNS_R_NXDOMAIN:                                    \
+               case DNS_R_YXDOMAIN:                                    \
+               case DNS_R_YXRRSET:                                     \
+               case DNS_R_NXRRSET:                                     \
+                       _what = "unsuccessful";                         \
+               }                                                       \
                if (isc_log_wouldlog(ns_g_lctx, LOGLEVEL_PROTOCOL)) {   \
                        char _nbuf[DNS_NAME_FORMATSIZE];                \
                        char _tbuf[DNS_RDATATYPE_FORMATSIZE];           \
                        dns_name_format(name, _nbuf, sizeof(_nbuf));    \
                        dns_rdatatype_format(type, _tbuf, sizeof(_tbuf)); \
                        update_log(client, zone, LOGLEVEL_PROTOCOL,     \
-                                  "update failed: %s/%s: %s (%s)",     \
-                                  _nbuf, _tbuf, msg,                   \
+                                  "update %s: %s/%s: %s (%s)",         \
+                                  _what, _nbuf, _tbuf, msg,            \
                                   isc_result_totext(result));          \
                }                                                       \
                if (result != ISC_R_SUCCESS) goto failure;              \
 #define FAILS(code, msg) \
        do {                                                    \
                result = (code);                                \
-               update_log(client, zone, LOGLEVEL_PROTOCOL,             \
+               update_log(client, zone, LOGLEVEL_PROTOCOL,     \
                              "error: %s: %s",                  \
                              msg, isc_result_totext(result));  \
                if (result != ISC_R_SUCCESS) goto failure;      \