]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1602. [bug] Logging to a file failed unless a size was specified.
authorMark Andrews <marka@isc.org>
Sat, 10 Apr 2004 04:30:06 +0000 (04:30 +0000)
committerMark Andrews <marka@isc.org>
Sat, 10 Apr 2004 04:30:06 +0000 (04:30 +0000)
                        [RT# 10925]

CHANGES
lib/isc/include/isc/log.h
lib/isc/log.c

diff --git a/CHANGES b/CHANGES
index 1716ed5b79b2f073c124b81ba53fac65fe665b1e..21cbc9b3a33456c9ef31fe32dbccd8d9c355c215 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,9 @@
 1603.  [bug]           nsupdate: set interactive based on isatty().
                        [RT# 10929]
 
+1602.  [bug]           Logging to a file failed unless a size was specified.
+                       [RT# 10925]
+
 1455.   [bug]           <netaddr> missing from server grammar in
                         doc/misc/options. [RT #5616]
 
index b03d5679692347c1c93f085ee716729081d601a9..6f91720584a8313fe07b02ccb62dbef378a57e35 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: log.h,v 1.39.2.5 2004/03/09 06:11:57 marka Exp $ */
+/* $Id: log.h,v 1.39.2.6 2004/04/10 04:30:06 marka Exp $ */
 
 #ifndef ISC_LOG_H
 #define ISC_LOG_H 1
@@ -96,6 +96,8 @@ struct isc_logmodule {
  * channel the name, versions and maximum_size should be set before calling
  * isc_log_createchannel().  To define an ISC_LOG_TOFILEDESC channel set only
  * the stream before the call.
+ * 
+ * Setting maximum_size to zero implies no maximum.
  */
 typedef struct isc_logfile {
        FILE *stream;           /* Initialized to NULL for ISC_LOG_TOFILE. */
index e1fd8e38ae012803eed851dbf14fe0f5a2c7f5d7..ee48b00ac8163b4fb974174bd3ae7937d71b54c9 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: log.c,v 1.70.2.11 2004/03/09 06:11:47 marka Exp $ */
+/* $Id: log.c,v 1.70.2.12 2004/04/10 04:30:05 marka Exp $ */
 
 /* Principal Authors: DCL */
 
@@ -1316,7 +1316,7 @@ isc_log_open(isc_logchannel_t *channel) {
        if (stat(path, &statbuf) == 0) {
                regular_file = S_ISREG(statbuf.st_mode) ? ISC_TRUE : ISC_FALSE;
                /* XXXDCL if not regular_file complain? */
-               roll = ISC_TF(regular_file &&
+               roll = ISC_TF(regular_file && FILE_MAXSIZE(channel) > 0 &&
                              statbuf.st_size >= FILE_MAXSIZE(channel));
        } else if (errno == ENOENT)
                regular_file = ISC_TRUE;
@@ -1710,7 +1710,7 @@ isc_log_doit(isc_log_t *lctx, isc_logcategory_t *category,
                         * threshold, note it so that it will not be logged
                         * to any more.
                         */
-                       if (FILE_MAXSIZE(channel) != 0) {
+                       if (FILE_MAXSIZE(channel) > 0) {
                                INSIST(channel->type == ISC_LOG_TOFILE);
 
                                /* XXXDCL NT fstat/fileno */