From: serassio <> Date: Mon, 7 Mar 2005 04:48:55 +0000 (+0000) Subject: Syslog is not available on all platforms. X-Git-Tag: SQUID_3_0_PRE4~859 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bc0f38f5cc5bb18d2c9feb569d0f23fc0b5dee2;p=thirdparty%2Fsquid.git Syslog is not available on all platforms. Added #if HAVE_SYSLOG to allow build on every OS. --- diff --git a/src/logfile.cc b/src/logfile.cc index 52db87283a..22414d3d48 100644 --- a/src/logfile.cc +++ b/src/logfile.cc @@ -1,5 +1,5 @@ /* - * $Id: logfile.cc,v 1.16 2005/03/02 20:57:35 hno Exp $ + * $Id: logfile.cc,v 1.17 2005/03/06 21:48:55 serassio Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Duane Wessels @@ -46,11 +46,15 @@ logfileOpen(const char *path, size_t bufsz, int fatal_flag) xstrncpy(lf->path, path, MAXPATHLEN); +#if HAVE_SYSLOG + if (strcmp(path, "syslog") == 0) { lf->flags.syslog = 1; lf->syslog_priority = LOG_INFO; lf->fd = -1; - } else { + } else +#endif + { fd = file_open(path, O_WRONLY | O_CREAT | O_TEXT); if (DISK_ERROR == fd) { @@ -153,11 +157,15 @@ logfileRotate(Logfile * lf) void logfileWrite(Logfile * lf, void *buf, size_t len) { +#if HAVE_SYSLOG + if (lf->flags.syslog) { syslog(lf->syslog_priority, "%s", (char *)buf); return; } +#endif + if (0 == lf->bufsz) { /* buffering disabled */ logfileWriteWrapper(lf, buf, len);