--------------------- PatchSet 7854 Date: 2006/05/21 23:56:52 Author: hno Branch: customlog-2_5 Tag: (none) Log: The syslog facility support imported from Squid-3 was a bit C++ centric.. translated to C. Members: src/logfile.c:1.5.38.3.4.3->1.5.38.3.4.4 Index: squid/src/logfile.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/logfile.c,v retrieving revision 1.5.38.3.4.3 retrieving revision 1.5.38.3.4.4 diff -u -r1.5.38.3.4.3 -r1.5.38.3.4.4 --- squid/src/logfile.c 15 May 2006 11:49:36 -0000 1.5.38.3.4.3 +++ squid/src/logfile.c 21 May 2006 23:56:52 -0000 1.5.38.3.4.4 @@ -37,16 +37,16 @@ static void logfileWriteWrapper(Logfile * lf, const void *buf, size_t len); #if HAVE_SYSLOG -struct syslog_symbol_t { +typedef struct { const char *name; int value; -}; +}syslog_symbol_t; static int syslog_ntoa(const char *s) { #define syslog_symbol(a) #a, a - static syslog_symbol_t _symbols[] = + static syslog_symbol_t symbols[] = { #ifdef LOG_AUTHPRIV {syslog_symbol(LOG_AUTHPRIV)}, @@ -98,7 +98,9 @@ #endif {NULL, 0} }; - for (syslog_symbol_t * p = _symbols; p->name != NULL; ++p) + syslog_symbol_t *p; + + for (p = symbols; p->name != NULL; ++p) if (!strcmp(s, p->name) || !strcmp(s, p->name + 4)) return p->value; return 0; @@ -117,7 +119,7 @@ lf->flags.syslog = 1; lf->fd = -1; if (path[6] != '\0') { - char *priority = path + 7; + const char *priority = path + 7; char *facility = strchr(priority, '|'); if (facility) { *facility++ = '\0'; @@ -125,7 +127,7 @@ } lf->syslog_priority |= syslog_ntoa(priority); } - if (lf->syslog_priority & PRIORITY_MASK == 0) + if ((lf->syslog_priority & PRIORITY_MASK) == 0) lf->syslog_priority |= LOG_INFO; } else #endif