From: wessels <> Date: Wed, 27 Mar 1996 12:12:36 +0000 (+0000) Subject: add configure checks for SYSLOG X-Git-Tag: SQUID_3_0_PRE1~6373 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db40ae20d21ccd6abc37ab4e437fd56c5055c701;p=thirdparty%2Fsquid.git add configure checks for SYSLOG --- diff --git a/configure b/configure index aa60802502..118cb81baf 100755 --- a/configure +++ b/configure @@ -517,7 +517,7 @@ fi -# From configure.in Revision: 1.9 +# From configure.in Revision: 1.10 ac_aux_dir= for ac_dir in aux $srcdir/aux; do if test -f $ac_dir/install-sh; then @@ -1236,10 +1236,27 @@ EOF fi -for ac_hdr in config.h fcntl.h memory.h stdlib.h string.h unistd.h \ - syslog.h sys/file.h sys/types.h sys/syslog.h sys/time.h \ - regex.h netinet/in.h arpa/inet.h crypt.h alloca.h \ - bstring.h sys/select.h + +for ac_hdr in \ + alloca.h \ + arpa/inet.h \ + bstring.h \ + config.h \ + crypt.h \ + fcntl.h \ + memory.h \ + netinet/in.h \ + stdlib.h \ + string.h \ + strings.h \ + sys/file.h \ + sys/select.h\ + sys/time.h \ + sys/types.h \ + unistd.h \ + regex.h \ + syslog.h \ + do ac_safe=`echo "$ac_hdr" | tr './\055' '___'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 @@ -1247,7 +1264,7 @@ if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -1275,8 +1292,9 @@ else fi done + cat > conftest.$ac_ext < EOF @@ -1299,7 +1317,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1333,7 +1351,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1367,7 +1385,7 @@ if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return 0; } @@ -1399,7 +1417,7 @@ if eval "test \"`echo '$''{'ac_cv_func_alloca'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < header file. */ #undef HAVE_STRING_H +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H @@ -109,9 +115,6 @@ /* Define if you have the header file. */ #undef HAVE_SYS_SELECT_H -/* Define if you have the header file. */ -#undef HAVE_SYS_SYSLOG_H - /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H diff --git a/src/debug.cc b/src/debug.cc index 504c2a44e2..d14d4c8de4 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,4 +1,4 @@ -/* $Id: debug.cc,v 1.3 1996/03/27 01:45:58 wessels Exp $ */ +/* $Id: debug.cc,v 1.4 1996/03/27 05:12:38 wessels Exp $ */ #include "squid.h" @@ -67,12 +67,14 @@ void _db_print(va_alist) } sprintf(f, "[%s] %s:%d:\t %s", the_time, module, _db_line, format); +#if HAVE_SYSLOG /* level 0 go to syslog */ if ((level == 0) && syslog_enable) { tmpbuf[0] = '\0'; vsprintf(tmpbuf, f, args); syslog(LOG_ERR, tmpbuf); } +#endif /* HAVE_SYSLOG */ /* write to log file */ vfprintf(debug_log, f, args); if (unbuffered_logs) @@ -127,9 +129,11 @@ void _db_init(prefix, initial_level, logfile) stderr_enable = 0; } - if (syslog_enable) { +#if HAVE_SYSLOG + if (syslog_enable) openlog("cached", LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); - } +#endif /* HAVE_SYSLOG */ + } /* gack! would be nice to use _db_init() instead */ diff --git a/src/squid.h b/src/squid.h index ecb33dd4dd..79051d41d7 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,5 +1,5 @@ -/* $Id: squid.h,v 1.2 1996/03/27 04:42:09 wessels Exp $ */ +/* $Id: squid.h,v 1.3 1996/03/27 05:12:39 wessels Exp $ */ #include "config.h" #include "autoconf.h" @@ -17,24 +17,24 @@ #include #include #include -#include -#include +#include #include -#include -#include +#include +#include /* needs sys/time.h above it */ #include #include #include #include #include -#include #include #include -#include -#include -#if HAVE_SYS_SELECT_H -#include +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef HAVE_STRINGS_H +#include #endif #if HAVE_BSTRING_H @@ -45,6 +45,14 @@ #include #endif +#ifdef HAVE_SYSLOG_H +#include +#endif + +#if HAVE_SYS_SELECT_H +#include +#endif + #if defined(__STRICT_ANSI__) #include #else diff --git a/src/store.cc b/src/store.cc index e15136ffd6..f0366475a3 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,5 +1,5 @@ -/* $Id: store.cc,v 1.11 1996/03/27 04:42:09 wessels Exp $ */ +/* $Id: store.cc,v 1.12 1996/03/27 05:12:39 wessels Exp $ */ /* * Here is a summary of the routines which change mem_status and swap_status: @@ -2331,8 +2331,10 @@ void storeSanityCheck() if (errno != ENOENT) continue; sprintf(tmpbuf, "WARNING: Cannot write to %s for storage swap area.\nForcing a *full restart* (e.g., cached -z)...", name); +#if HAVE_SYSLOG if (syslog_enable) syslog(LOG_ALERT, tmpbuf); +#endif fprintf(stderr, "cached: %s\n", tmpbuf); zap_disk_store = 1; return; diff --git a/src/tools.cc b/src/tools.cc index cc4b821633..a65c58927b 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,5 +1,5 @@ -/* $Id: tools.cc,v 1.8 1996/03/27 04:42:10 wessels Exp $ */ +/* $Id: tools.cc,v 1.9 1996/03/27 05:12:40 wessels Exp $ */ #include "squid.h" @@ -102,8 +102,10 @@ void shut_down(sig) void fatal_common(message) char *message; { +#if HAVE_SYSLOG if (syslog_enable) syslog(LOG_ALERT, message); +#endif fprintf(stderr, "FATAL: %s\n", message); fprintf(stderr, "Harvest Cache (Version %s): Terminated abnormally.\n", SQUID_VERSION);