mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
ios: Fail Crashpad initialization with invalid database path.
Bug: crashpad:31 Change-Id: I1853af83a18675bee6dd99636f179db127e1ac47 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/3247291 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Justin Cohen <justincohen@chromium.org>
This commit is contained in:
parent
9c6a751e4b
commit
15c4663b8c
@ -28,13 +28,15 @@
|
||||
namespace {
|
||||
|
||||
// Creates directory at |path|.
|
||||
void CreateDirectory(const base::FilePath& path) {
|
||||
bool CreateDirectory(const base::FilePath& path) {
|
||||
if (mkdir(path.value().c_str(), 0755) == 0) {
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
if (errno != EEXIST) {
|
||||
PLOG(ERROR) << "mkdir " << path.value();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// The file extension used to indicate a file is locked.
|
||||
@ -63,6 +65,9 @@ bool InProcessHandler::Initialize(
|
||||
INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
|
||||
annotations_ = annotations;
|
||||
database_ = CrashReportDatabase::Initialize(database);
|
||||
if (!database_) {
|
||||
return false;
|
||||
}
|
||||
bundle_identifier_and_seperator_ =
|
||||
system_data.BundleIdentifier() + kBundleSeperator;
|
||||
|
||||
@ -80,11 +85,13 @@ bool InProcessHandler::Initialize(
|
||||
database_.get(), url, upload_thread_options));
|
||||
}
|
||||
|
||||
CreateDirectory(database);
|
||||
if (!CreateDirectory(database))
|
||||
return false;
|
||||
static constexpr char kPendingSerializediOSDump[] =
|
||||
"pending-serialized-ios-dump";
|
||||
base_dir_ = database.Append(kPendingSerializediOSDump);
|
||||
CreateDirectory(base_dir_);
|
||||
if (!CreateDirectory(base_dir_))
|
||||
return false;
|
||||
|
||||
prune_thread_.reset(new PruneIntermediateDumpsAndCrashReportsThread(
|
||||
database_.get(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user