Revert "Fixed: logrotation may stop after config change"

This reverts commit ede4aee619.
This commit is contained in:
z3APA3A 2019-01-14 20:14:08 +03:00
parent ede4aee619
commit d7373be071

View File

@ -285,6 +285,10 @@ static int h_log(int argc, unsigned char ** argv){
havelog = 1;
if(argc > 1 && conf.logtarget && *argv[1]!= '&' && *argv[1]!= '@' && !strcmp((char *)conf.logtarget, (char *)argv[1])) {
conf.logfunc = logstdout;
return 0;
}
if(conf.logtarget){
myfree(conf.logtarget);
conf.logtarget = NULL;
@ -319,7 +323,6 @@ static int h_log(int argc, unsigned char ** argv){
if(argc > 2) {
conf.logtype = getrotate(*argv[2]);
}
if(!strcmp((char *)conf.logtarget, (char *)argv[1])) return 0;
conf.logtime = time(0);
if(conf.logname)myfree(conf.logname);
conf.logname = (unsigned char *)mystrdup((char *)argv[1]);