would fail to find the first member of any category
or module array apart from the internal defaults.
Thus, for example, the "notify" category was improperly
configured by named.
This resolves RT #132, "Logging channels definition problems."
Mostly, several functions that take pointers as arguments, almost
always char * pointers, had those pointers qualified with "const".
Those that returned pointers to previously const-qualified arguments
had their return values qualified as const. Some structure members
were qualified as const to retain that attribute from the variables
from which they were assigned.
The macro DE_CONST was added to isc/util.h to deal with a handful of very
special places where something is qualified as const but really needs to have
its const qualifier removed.
Also cleaned up a few places where variable names clashed with reserved
identifiers. (Which mostly works fine, but strictly speaking is undefined
by the standard.)
Minor other ISC style cleanups.
the logconfig is properly dimensioned, and only free the channellist
memory in isc_logconfig_destroy if the channellist_count is > 0.
the first addresses a problem that could occur when a successful
isc_log_create was followed immediately by isc_log_[v]write[1] or
isc_log_destroy (with no intervening isc_log_usechannel or
isc_logconfig_use), and the second addresses a problem that could
occur in cleanup if isc_log_create or isc_logconfig_create failed.
Use isc_time_secondsastimet() to set a time_t variable.
Properly skip the duplicate checking loop if the boundary time is not
successfully set (this was intended before, but coded wrongly).
Removed unused variable pid_string, after I opted to not add the
unrequested ISC_LOG_PRINTPID option half way into implementing it.
Cleanup of redundant/useless header file inclusion.
ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
/*
* This is a comment.
*/
macros.
ISC_LOG_DEBUGONLY flag for a channel added, to mark a channel that should
only be used if the debugging level is non-zero.
Use ISC_LOG_DEBUGONLY for default_debug.
REQUIRE the context is valid for isc_logconfig_get, and ENSURE that
the configuration returned is non-NULL.
Other miscellaneous cleanups.
return an isc_logconfig_t. isc_log_cretechannel and isc_log_usechannel
now take an isc_logconfig_t instead of an isc_log_t; this is to address
reconfiguration in a multithreaded environment.
isc_logconfig_create, isc_logconfig_get, isc_logconfig_use and
isc_logconfig_destroy were added to work with the new isc_logconfig_t type.
isc_logregister_categories and dns_log_init are now both void rather than
returning isc_result_t.
isc_log_vwrite1(), configurable over X seconds using
isc_log_setduplicateinterval().
isc_log_vwrite renamed to static isc_log_doit(), isc_log_vwrite() created
as wrapper for isc_log_doit().
don't do a second test on ISC_LOG_PRINTLEVEL when logging the message to add
a colon-space, since the colon-space is already in level_string.
print "no_module: " if a module has not been specified (but PRINTMODULE was),
to keep tokenization nice and clean for future log-file parsing programs
without looking quite like a bug, which is what happens with:
Oct 25 15:51:07 dns_general: : notice: This should be in file 1/1
instead of
Oct 25 15:51:07 dns_general: no_module: notice: This should be in file 1/1