* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: master.c,v 1.122.2.1 2001/09/04 22:51:37 gson Exp $ */
+/* $Id: master.c,v 1.122.2.2 2001/09/11 23:32:55 gson Exp $ */
#include <config.h>
#define MANYERRS(lctx, result) \
((result != ISC_R_SUCCESS) && \
((lctx)->options & DNS_MASTER_MANYERRORS) != 0)
+
#define SETRESULT(lctx, r) \
do { \
if ((lctx)->result == ISC_R_SUCCESS) \
(lctx)->result = r; \
} while (0)
+
+#define LOGITFILE(result, filename) \
+ if (result == ISC_R_INVALIDFILE || result == ISC_R_FILENOTFOUND || \
+ result == ISC_R_IOERROR || result == ISC_R_TOOMANYOPENFILES || \
+ result == ISC_R_NOPERM) \
+ (*callbacks->error)(callbacks, "%s: %s:%lu: %s: %s", \
+ "dns_master_load", source, line, \
+ filename, dns_result_totext(result)); \
+ else LOGIT(result)
+
#define LOGIT(result) \
if (result == ISC_R_NOMEMORY) \
(*callbacks->error)(callbacks, "dns_master_load: %s", \
ictx->origin, lctx);
if (MANYERRS(lctx, result)) {
SETRESULT(lctx, result);
- LOGIT(result);
+ LOGITFILE(result, include_file);
continue;
- } else if (result != ISC_R_SUCCESS)
- goto log_and_cleanup;
+ } else if (result != ISC_R_SUCCESS) {
+ LOGITFILE(result, include_file);
+ goto insist_and_cleanup;
+ }
ictx = lctx->inc;
line = isc_lex_getsourceline(lctx->lex);
source =
result = pushfile(include_file, new_name, lctx);
if (MANYERRS(lctx, result)) {
SETRESULT(lctx, result);
- LOGIT(result);
+ LOGITFILE(result, include_file);
continue;
- } else if (result != ISC_R_SUCCESS)
- goto log_and_cleanup;
+ } else if (result != ISC_R_SUCCESS) {
+ LOGITFILE(result, include_file);
+ goto insist_and_cleanup;
+ }
ictx = lctx->inc;
line = isc_lex_getsourceline(lctx->lex);
source = isc_lex_getsourcename(lctx->lex);