From bd55cc45d56189099bcca8ea62af7e67c38ce329 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 3 Jul 2000 05:53:58 +0000 Subject: [PATCH] Fixed file purging bug. The purging should work now ok. --- lib/silccore/silclog.c | 9 ++++++--- lib/silccore/silclog.h | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/silccore/silclog.c b/lib/silccore/silclog.c index d866ecc0..cc74119d 100644 --- a/lib/silccore/silclog.c +++ b/lib/silccore/silclog.c @@ -20,8 +20,11 @@ /* * $Id$ * $Log$ - * Revision 1.1 2000/06/27 11:36:55 priikone - * Initial revision + * Revision 1.2 2000/07/03 05:53:58 priikone + * Fixed file purging bug. The purging should work now ok. + * + * Revision 1.1.1.1 2000/06/27 11:36:55 priikone + * Importet from internal CVS/Added Log headers. * * */ @@ -81,7 +84,7 @@ void silc_log_output(const char *filename, unsigned int maxsize, fseek(fp, (off_t)0L, SEEK_SET); /* Purge? */ - if (maxsize >= filelen) + if (filelen >= maxsize) unlink(filename); } } diff --git a/lib/silccore/silclog.h b/lib/silccore/silclog.h index 3cfc499a..a98e4af4 100644 --- a/lib/silccore/silclog.h +++ b/lib/silccore/silclog.h @@ -52,10 +52,10 @@ extern unsigned int log_error_size; extern unsigned int log_fatal_size; /* Log macros. */ -#define SILC_LOG_INFO(fmt) silc_log_output(log_info_file, \ +#define SILC_LOG_INFO(fmt) (silc_log_output(log_info_file, \ log_info_size, \ SILC_LOG_INFO, \ - silc_log_format fmt)) + silc_log_format fmt)) #define SILC_LOG_WARNING(fmt) (silc_log_output(log_warning_file, \ log_warning_size, \ SILC_LOG_WARNING, \ -- 2.24.0