ticket refs #4591: CWMP: incorrect logging to syslog (fix log_to_sylog uci option behaviour)

This commit is contained in:
Omar Kallel 2021-03-25 10:38:46 +01:00
parent 00ac93d867
commit 09a669ffa8

6
log.c
View file

@ -80,7 +80,7 @@ extern char *__progname;
int log_set_on_syslog(char *value)
{
if (strcmp(value, "enable") == 0) {
if ((strcasecmp(value, "TRUE") == 0) || (strcmp(value, "1") == 0) || (strcasecmp(value, "enable") == 0)) {
char ident[256];
enable_log_syslog = true;
@ -89,9 +89,7 @@ int log_set_on_syslog(char *value)
snprintf(ident, sizeof(ident), "%s[%d]", __progname, getpid());
ident[sizeof(ident) - 1] = '\0';
openlog(ident, LOG_NDELAY, LOG_LOCAL1);
}
if (strcmp(value, "disable") == 0) {
} else {
enable_log_syslog = false;
}
return 1;