From 6043f8e453cdf8af37b75769c64cffe611002fd8 Mon Sep 17 00:00:00 2001 From: Evgeniy Kozhuhovskiy Date: Sun, 2 Jan 2005 08:43:07 +0000 Subject: [PATCH] small fixes --- SYSLOG | 7 +++---- TODO | 5 ++++- source/Makefile | 2 +- source/bforce/logger.c | 39 ++++++--------------------------------- 4 files changed, 14 insertions(+), 39 deletions(-) diff --git a/SYSLOG b/SYSLOG index 1c021e9..690f3b8 100644 --- a/SYSLOG +++ b/SYSLOG @@ -1,10 +1,9 @@ Now binkleyforce supports logging to syslog (see syslogd(8) for details) -It uses LOG_UUCP facility, LOG_PID option. LOG_ERR and LOG_NOTICE +You can define facility; LOG_PID option, LOG_ERR and LOG_NOTICE levels are used. -To enable it, uncomment line 19 in source/include/logger.h -( /* #define USE_SYSLOG */ ) +To enable it, add -DUSE_SYSLOG to CFLAGS in Makefile -TODO: add option to ``configure'' script \ No newline at end of file +TODO: add option to ``configure'' script diff --git a/TODO b/TODO index c9b0164..7826657 100644 --- a/TODO +++ b/TODO @@ -7,5 +7,8 @@ smart means (1) write time stat for every line and (2) evenly select a line to make a call + add bind_ip option - - fix Exec feature + - fix Exec features + add to ``configure'' --with-syslog key + - fix reread configs with kill -1 + - fix debug + - fix domains support diff --git a/source/Makefile b/source/Makefile index 260cded..3c277f6 100644 --- a/source/Makefile +++ b/source/Makefile @@ -6,7 +6,7 @@ CC = gcc INCLUDES = -I./include -CFLAGS = -g -O2 +CFLAGS = -g -O2 -DUSE_SYSLOG LIBS = YACC = bison -y INSTALL = /usr/bin/install -c diff --git a/source/bforce/logger.c b/source/bforce/logger.c index 9dd7fb7..f7a4de4 100644 --- a/source/bforce/logger.c +++ b/source/bforce/logger.c @@ -2,7 +2,8 @@ * binkleyforce -- unix FTN mailer project * * Copyright (c) 1998-2000 Alexander Belkin, 2:5020/1398.11 - * + * Copyright (c) 2004 Evgeniy Kozhuhovskiy, 2:450/256 + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -64,7 +65,7 @@ struct debuglevel { #include -#endif /* ifdef USE_SYSLOG */ +#endif /* USE_SYSLOG */ #ifndef USE_SYSLOG const char *log_getfilename(int whatfor) @@ -177,13 +178,6 @@ int log_reopen(const char *logname, const char *ext, const char *tty) return log_open(logname, ext, tty); } -/* void log_setident(const char *ident) -{ - if( ident ) - strnxcpy(log_ident, ident, sizeof(log_ident)); - else - *log_ident = '\0'; -} */ int log(const char *s, ...) @@ -297,7 +291,7 @@ int logerr(const char *s, ...) return 0; } -#endif /* ifndef USE_SYSLOG */ +#endif /* USE_SYSLOG */ #ifdef USE_SYSLOG @@ -363,13 +357,6 @@ int log(const char *s, ...) else fprintf(log_priority, "%s [%d] ", timestr, mypid); - -/* vsyslog(log_priority, s, args);*/ -/* putc('\n', log_fp); - fflush(log_fp); - - } */ - va_end(args); return 0; @@ -390,28 +377,14 @@ int logerr(const char *s, ...) int mypid = getpid(); -/* if( log_ident[0] && log_ttyname[0] ) - syslog(log_priority, "%s %s.%s[%d] ", timestr, log_ident, log_ttyname, mypid); - else if( log_ident[0] ) - syslog(log_priority, "%s %s[%d] ", timestr, log_ident, mypid); - else if( log_ttyname[0] ) - fprintf(log_priority, "%s %s[%d] ", timestr, log_ttyname, mypid); - else - fprintf(log_priority, "%s [%d] ", timestr, mypid); -*/ - vsyslog(log_priority, s, args); -/* putc('\n', log_fp); - fflush(log_fp); - - } */ va_end(args); return 0; } -#endif /* ifdef USE_SYSLOG */ +#endif /* USE_SYSLOG */ /* @@ -530,7 +503,7 @@ int debug_close(void) if( debug_fp ) { fprintf(debug_fp, "****************************************************\n"); - fprintf(debug_fp, " Closing Binkley-Force debug file at %s\n", + fprintf(debug_fp, " Closing binkleyforce debug file at %s\n", time_string_long(buf, sizeof(buf), 0)); fprintf(debug_fp, "****************************************************\n");