mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Check return values or cast them to (void), as required by the coding
standards; add exceptions to the coding standards for cases where this is not desirable
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: log.c,v 1.71 2001/08/31 21:51:24 gson Exp $ */
|
||||
/* $Id: log.c,v 1.72 2001/11/30 01:59:34 gson Exp $ */
|
||||
|
||||
/* Principal Authors: DCL */
|
||||
|
||||
@@ -1003,7 +1003,7 @@ isc_log_gettag(isc_logconfig_t *lcfg) {
|
||||
/* XXXDCL NT -- This interface will assuredly be changing. */
|
||||
void
|
||||
isc_log_opensyslog(const char *tag, int options, int facility) {
|
||||
openlog(tag, options, facility);
|
||||
(void)openlog(tag, options, facility);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1437,22 +1437,11 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
|
||||
|
||||
if ((channel->flags & ISC_LOG_PRINTTIME) != 0 &&
|
||||
time_string[0] == '\0') {
|
||||
isc_time_t isctime;
|
||||
|
||||
result = isc_time_now(&isctime);
|
||||
if (result == ISC_R_SUCCESS)
|
||||
isc_time_formattimestamp(&isctime, time_string,
|
||||
sizeof(time_string));
|
||||
else
|
||||
/*
|
||||
* "Should never happen."
|
||||
*/
|
||||
snprintf(time_string, sizeof(time_string),
|
||||
isc_msgcat_get(isc_msgcat,
|
||||
ISC_MSGSET_LOG,
|
||||
ISC_MSG_BADTIME,
|
||||
"Bad 00 99:99:99.999"));
|
||||
|
||||
isc_time_t isctime;
|
||||
|
||||
TIME_NOW(&isctime);
|
||||
isc_time_formattimestamp(&isctime, time_string,
|
||||
sizeof(time_string));
|
||||
}
|
||||
|
||||
if ((channel->flags & ISC_LOG_PRINTLEVEL) != 0 &&
|
||||
@@ -1495,10 +1484,9 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
|
||||
* which fall within the duplicate_interval
|
||||
* range.
|
||||
*/
|
||||
if (isc_time_now(&oldest) != ISC_R_SUCCESS ||
|
||||
isc_time_subtract(&oldest, &interval,
|
||||
&oldest) !=
|
||||
ISC_R_SUCCESS)
|
||||
TIME_NOW(&oldest);
|
||||
if (isc_time_subtract(&oldest, &interval, &oldest)
|
||||
!= ISC_R_SUCCESS)
|
||||
/*
|
||||
* Can't effectively do the checking
|
||||
* without having a valid time.
|
||||
@@ -1570,16 +1558,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
|
||||
new->text = (char *)(new + 1);
|
||||
strcpy(new->text, lctx->buffer);
|
||||
|
||||
if (isc_time_now(&new->time) !=
|
||||
ISC_R_SUCCESS)
|
||||
/*
|
||||
* This will cause the message
|
||||
* to immediately expire on
|
||||
* the next call to [v]write1.
|
||||
* What's a fella to do if
|
||||
* getting the time fails?
|
||||
*/
|
||||
isc_time_settoepoch(&new->time);
|
||||
TIME_NOW(&new->time);
|
||||
|
||||
ISC_LIST_APPEND(lctx->messages,
|
||||
new, link);
|
||||
@@ -1615,7 +1594,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
|
||||
(stat(FILE_NAME(channel), &statbuf) != 0 &&
|
||||
errno == ENOENT) ||
|
||||
statbuf.st_size < FILE_MAXSIZE(channel)) {
|
||||
fclose(FILE_STREAM(channel));
|
||||
(void)fclose(FILE_STREAM(channel));
|
||||
FILE_STREAM(channel) = NULL;
|
||||
FILE_MAXREACHED(channel) = ISC_FALSE;
|
||||
} else
|
||||
@@ -1679,7 +1658,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
|
||||
else
|
||||
syslog_level = syslog_map[-level];
|
||||
|
||||
syslog(FACILITY(channel) | syslog_level,
|
||||
(void)syslog(FACILITY(channel) | syslog_level,
|
||||
"%s%s%s%s%s%s%s%s%s",
|
||||
printtime ? time_string : "",
|
||||
printtag ? lcfg->tag : "",
|
||||
|
Reference in New Issue
Block a user