aboutsummaryrefslogtreecommitdiffstats
path: root/logger.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-14 23:36:30 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-12-14 23:36:30 +0000
commit70cedacdde512d2ed5984eec242c55f3239b73fc (patch)
tree48694f38698e4ead3840305333816193c7fcd8a0 /logger.c
parentc60f8a2b8e1551244e674baff85cb1a4f2d5fd5b (diff)
Merge slimey's Solaris compatibility (with small mods) (bug #2740)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4446 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'logger.c')
-rwxr-xr-xlogger.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/logger.c b/logger.c
index e9e75b831..5fb0348af 100755
--- a/logger.c
+++ b/logger.c
@@ -136,7 +136,9 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
{
struct logchannel *chan;
char *facility;
+#ifndef SOLARIS
CODE *cptr;
+#endif
if (ast_strlen_zero(channel))
return NULL;
@@ -155,6 +157,8 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
if(!facility++ || !facility) {
facility = "local0";
}
+
+#ifndef SOLARIS
/*
* Walk through the list of facilitynames (defined in sys/syslog.h)
* to see if we can find the one we have been given
@@ -168,6 +172,46 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
}
cptr++;
}
+#else
+ chan->facility = -1;
+ if (!strcasecmp(facility, "kern"))
+ chan->facility = LOG_KERN;
+ else if (!strcasecmp(facility, "USER"))
+ chan->facility = LOG_USER;
+ else if (!strcasecmp(facility, "MAIL"))
+ chan->facility = LOG_MAIL;
+ else if (!strcasecmp(facility, "DAEMON"))
+ chan->facility = LOG_DAEMON;
+ else if (!strcasecmp(facility, "AUTH"))
+ chan->facility = LOG_AUTH;
+ else if (!strcasecmp(facility, "SYSLOG"))
+ chan->facility = LOG_SYSLOG;
+ else if (!strcasecmp(facility, "LPR"))
+ chan->facility = LOG_LPR;
+ else if (!strcasecmp(facility, "NEWS"))
+ chan->facility = LOG_NEWS;
+ else if (!strcasecmp(facility, "UUCP"))
+ chan->facility = LOG_UUCP;
+ else if (!strcasecmp(facility, "CRON"))
+ chan->facility = LOG_CRON;
+ else if (!strcasecmp(facility, "LOCAL0"))
+ chan->facility = LOG_LOCAL0;
+ else if (!strcasecmp(facility, "LOCAL1"))
+ chan->facility = LOG_LOCAL1;
+ else if (!strcasecmp(facility, "LOCAL2"))
+ chan->facility = LOG_LOCAL2;
+ else if (!strcasecmp(facility, "LOCAL3"))
+ chan->facility = LOG_LOCAL3;
+ else if (!strcasecmp(facility, "LOCAL4"))
+ chan->facility = LOG_LOCAL4;
+ else if (!strcasecmp(facility, "LOCAL5"))
+ chan->facility = LOG_LOCAL5;
+ else if (!strcasecmp(facility, "LOCAL6"))
+ chan->facility = LOG_LOCAL6;
+ else if (!strcasecmp(facility, "LOCAL7"))
+ chan->facility = LOG_LOCAL7;
+#endif
+
if (0 > chan->facility) {
fprintf(stderr, "Logger Warning: bad syslog facility in logger.conf\n");
free(chan);