mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-28 00:10:59 -04:00
Minor logging fixes
This commit is contained in:
parent
e20b851f2d
commit
6706895ea5
11
src/err.c
11
src/err.c
@ -227,6 +227,7 @@ int err_settruncate(int truncate) {
|
|||||||
|
|
||||||
int err_setlogfile(char *file) {
|
int err_setlogfile(char *file) {
|
||||||
char *mode;
|
char *mode;
|
||||||
|
int result=TRUE;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(strcmp(file,err_filename) == 0)
|
if(strcmp(file,err_filename) == 0)
|
||||||
@ -241,23 +242,21 @@ int err_setlogfile(char *file) {
|
|||||||
mode = "a";
|
mode = "a";
|
||||||
if(err_truncate) mode = "w";
|
if(err_truncate) mode = "w";
|
||||||
|
|
||||||
memset(err_filename,0,sizeof(err_filename));
|
|
||||||
strncpy(err_filename,file,sizeof(err_filename)-1);
|
strncpy(err_filename,file,sizeof(err_filename)-1);
|
||||||
|
|
||||||
err_file = fopen(err_filename,mode);
|
err_file = fopen(err_filename,mode);
|
||||||
if(err_file == NULL) {
|
if(err_file == NULL) {
|
||||||
err_logdest &= ~LOGDEST_LOGFILE;
|
err_logdest &= ~LOGDEST_LOGFILE;
|
||||||
|
|
||||||
os_opensyslog(); // (app,LOG_PID,LOG_DAEMON);
|
if(!err_syslog_open)
|
||||||
|
os_opensyslog();
|
||||||
os_syslog(1,"Error opening logfile");
|
os_syslog(1,"Error opening logfile");
|
||||||
os_closesyslog();
|
|
||||||
|
|
||||||
_err_unlock();
|
result=FALSE;
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_err_unlock();
|
_err_unlock();
|
||||||
return TRUE;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user