diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp index fc26bedc..dc1c15d7 100644 --- a/td/telegram/files/FileManager.cpp +++ b/td/telegram/files/FileManager.cpp @@ -394,7 +394,12 @@ FileManager::FileManager(std::unique_ptr context) : context_(std::move( dirs.push_back(path.str()); auto status = mkdir(path, 0750); if (status.is_error()) { - LOG(FATAL) << "mkdir " << tag("path", path) << " failed " << status; + auto r_stat = stat(path); + if (r_stat.is_ok() && r_stat.ok().is_dir_) { + LOG(ERROR) << "mkdir " << tag("path", path) << " failed " << status << ", but directory exists"; + } else { + LOG(FATAL) << "mkdir " << tag("path", path) << " failed " << status; + } } #if TD_ANDROID FileFd::open(dirs.back() + ".nomedia", FileFd::Create | FileFd::Read).ignore(); diff --git a/tdutils/td/utils/Parser.h b/tdutils/td/utils/Parser.h index 32f0e3c4..06e95bf8 100644 --- a/tdutils/td/utils/Parser.h +++ b/tdutils/td/utils/Parser.h @@ -43,7 +43,7 @@ class Parser { void clear() { ptr_ = nullptr; end_ = ptr_; - status_ = Status(); + status_ = Status::OK(); } MutableSlice read_till_nofail(char c) {