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:
parent
b5f4b96060
commit
459488bcf8
|
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user