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

fix logrotate empty file hole issue (#1561)

* fix logrotate empty file hole issue
refer to https://github.com/ossrs/srs/issues/1554
This commit is contained in:
Michael.Ma 2020-01-08 17:54:06 +08:00 committed by winlin
parent b5f4b96060
commit 459488bcf8

View file

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