From 459488bcf8619601061954507fc2d70d24a9db42 Mon Sep 17 00:00:00 2001 From: "Michael.Ma" Date: Wed, 8 Jan 2020 17:54:06 +0800 Subject: [PATCH] fix logrotate empty file hole issue (#1561) * fix logrotate empty file hole issue refer to https://github.com/ossrs/srs/issues/1554 --- trunk/src/app/srs_app_log.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trunk/src/app/srs_app_log.cpp b/trunk/src/app/srs_app_log.cpp index 67f26930b..1c0a5dfd1 100644 --- a/trunk/src/app/srs_app_log.cpp +++ b/trunk/src/app/srs_app_log.cpp @@ -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 ); }