From e8e52a6a2557f3a6e6e3d50841eb545c9cf8d0cc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Jun 2006 18:35:19 +0300 Subject: Cleanup to patch for Bug#18246, "compilation error with tcp_wrapper" include/my_libwrap.h: Changed includes to the header file. mysys/my_libwrap.c: Added comment and .c file now takes needed includes from the corresponding .h file. sql/mysqld.cc: Include this block from my_libwra.h now. Moved two variables out of the otherwise same block. --- include/my_libwrap.h | 9 +++++++++ mysys/my_libwrap.c | 15 +++++++++------ sql/mysqld.cc | 13 +++---------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/include/my_libwrap.h b/include/my_libwrap.h index a5cc9879e4f..6437cbaed84 100644 --- a/include/my_libwrap.h +++ b/include/my_libwrap.h @@ -14,6 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_LIBWRAP +#include +#include +#ifdef NEED_SYS_SYSLOG_H +#include +#endif /* NEED_SYS_SYSLOG_H */ + extern void my_fromhost(struct request_info *req); extern int my_hosts_access(struct request_info *req); extern char *my_eval_client(struct request_info *req); + +#endif /* HAVE_LIBWRAP */ diff --git a/mysys/my_libwrap.c b/mysys/my_libwrap.c index 29a0ecf3fc6..be8adbab0a1 100644 --- a/mysys/my_libwrap.c +++ b/mysys/my_libwrap.c @@ -14,14 +14,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + This is needed to be able to compile with original libwrap header + files that don't have the prototypes +*/ + #include +#include + #ifdef HAVE_LIBWRAP -#include -#include -#ifdef NEED_SYS_SYSLOG_H -#include -#endif /* NEED_SYS_SYSLOG_H */ -#endif void my_fromhost(struct request_info *req) { @@ -37,3 +38,5 @@ char *my_eval_client(struct request_info *req) { eval_client(req); } + +#endif /* HAVE_LIBWRAP */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 262a5352ed9..b73cd350012 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -120,16 +120,7 @@ extern "C" { // Because of SCO 3.2V4.2 #include #endif /* __WIN__ */ -#ifdef HAVE_LIBWRAP -#include -#include -#ifdef NEED_SYS_SYSLOG_H -#include -#endif /* NEED_SYS_SYSLOG_H */ -int allow_severity = LOG_INFO; -int deny_severity = LOG_WARNING; - -#endif /* HAVE_LIBWRAP */ +#include #ifdef HAVE_SYS_MMAN_H #include @@ -591,6 +582,8 @@ static const char* default_dbug_option; #endif #ifdef HAVE_LIBWRAP const char *libwrapName= NULL; +int allow_severity = LOG_INFO; +int deny_severity = LOG_WARNING; #endif #ifdef HAVE_QUERY_CACHE static ulong query_cache_limit= 0; -- cgit v1.2.1