From 360bde1ab7b145f839f05420597b9b1eeaf91c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A6=E5=B0=9A=E7=8E=AE?= <2826256824@qq.com> Date: Fri, 30 Jul 2021 05:47:51 +0000 Subject: [PATCH] Bugfix: persister info file unexpectedly cleared --- services/hilogd/log_persister_rotator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/hilogd/log_persister_rotator.cpp b/services/hilogd/log_persister_rotator.cpp index 67e0982..37d37aa 100644 --- a/services/hilogd/log_persister_rotator.cpp +++ b/services/hilogd/log_persister_rotator.cpp @@ -41,7 +41,7 @@ void LogPersisterRotator::Init() mkdir(fileName.substr(0, nPos).c_str(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRWXG | S_IRWXO); } } - fdinfo = fopen((mmapPath + ".info").c_str(), "w+"); + fdinfo = fopen((mmapPath + ".info").c_str(), "r+"); } int LogPersisterRotator::Input(const char *buf, uint32_t length) -- Gitee