From 731e87876e811bd49f88642d8b73ff62008273bc Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 8 Jan 2020 17:57:04 +0800 Subject: [PATCH] Fix #1554, support logrotate copytruncate. 2.0.271 --- README.md | 2 ++ trunk/src/app/srs_app_log.cpp | 9 +-------- trunk/src/core/srs_core.hpp | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index ca203c440c..5e02d9afba 100755 --- a/README.md +++ b/README.md @@ -338,6 +338,7 @@ Remark: ## History +* v2.0, 2020-01-08, Merge [#1554][bug #1554], support logrotate copytruncate. 2.0.271 * v2.0, 2020-01-05, Merge [#1551][bug #1551], fix memory leak in RTSP stack. 2.0.270 * v2.0, 2019-12-26, For [#1488][bug #1488], pass client ip to http callback. 2.0.269 * v2.0, 2019-12-23, Fix [srs-librtmp #22](https://github.com/ossrs/srs-librtmp/issues/22), parse vhost splited by single seperator. 2.0.268 @@ -1361,6 +1362,7 @@ Winlin [bug #1304]: https://github.com/ossrs/srs/pull/1304 [bug #1488]: https://github.com/ossrs/srs/issues/1488 [bug #1551]: https://github.com/ossrs/srs/pull/1551 +[bug #1554]: https://github.com/ossrs/srs/pull/1554 [bug #xxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxx [exo #828]: https://github.com/google/ExoPlayer/pull/828 diff --git a/trunk/src/app/srs_app_log.cpp b/trunk/src/app/srs_app_log.cpp index 1c0a5dfd15..19ed6d253e 100644 --- a/trunk/src/app/srs_app_log.cpp +++ b/trunk/src/app/srs_app_log.cpp @@ -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); } diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 11ff884182..0108a48299 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 270 +#define VERSION_REVISION 271 // generated by configure, only macros. #include