+4309. [cleanup] Remove the spurious "none" filename from log messages
+ when processing built-in configuration. [RT #41594]
+
4308. [func] Added operating system details to "named -V"
output. [RT #41452]
return;
va_start(ap, fmt);
-
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
- isc_log_write(lctx, CAT, MOD, level,
- "%s:%u: %s",
- obj->file == NULL ? "<unknown file>" : obj->file,
- obj->line, msgbuf);
va_end(ap);
+
+ if (have_current_file(obj->pctx)) {
+ isc_log_write(lctx, CAT, MOD, level,
+ "%s:%u: %s", obj->file, obj->line, msgbuf);
+ } else {
+ isc_log_write(lctx, CAT, MOD, level, "%s", msgbuf);
+ }
}
const char *
obj = isc_mem_get(pctx->mctx, sizeof(cfg_obj_t));
if (obj == NULL)
return (ISC_R_NOMEMORY);
+
obj->type = type;
obj->file = current_file(pctx);
obj->line = pctx->line;
+ obj->pctx = pctx;
+
result = isc_refcount_init(&obj->references, 1);
if (result != ISC_R_SUCCESS) {
isc_mem_put(pctx->mctx, obj, sizeof(cfg_obj_t));
return (result);
}
*ret = obj;
+
return (ISC_R_SUCCESS);
}