Fix empty path in FileLog.

GitOrigin-RevId: be64892045a8ee3497f89963d8f18265b4f6991d
This commit is contained in:
levlam 2019-10-08 21:17:42 +03:00
parent ff97775549
commit c40a1217e8

View File

@ -18,13 +18,13 @@
namespace td {
Status FileLog::init(string path, int64 rotate_threshold, bool redirect_stderr) {
if (path.empty()) {
return Status::Error("Log file path can't be empty");
}
if (path == path_) {
set_rotate_threshold(rotate_threshold);
return Status::OK();
}
if (path.empty()) {
return Status::Error("Log file path can't be empty");
}
TRY_RESULT(fd, FileFd::open(path, FileFd::Create | FileFd::Write | FileFd::Append));