1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Fix #1554, support logrotate copytruncate. 2.0.271

This commit is contained in:
winlin 2020-01-08 17:57:04 +08:00
parent 459488bcf8
commit 731e87876e
3 changed files with 4 additions and 9 deletions

View file

@ -410,13 +410,6 @@ void SrsFastLog::open_log_file()
return;
}
fd = ::open(filename.c_str(), O_RDWR | O_APPEND);
if(fd == -1 && errno == ENOENT) {
fd = open(filename.c_str(),
O_RDWR | O_CREAT | O_TRUNC | O_APPEND/*logrotate copytruncate need this flag*/,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
);
}
fd = ::open(filename.c_str(), O_RDWR | O_CREAT | O_APPEND);
}