From ca8822188d9616a83fbac0705f12fe6c65289cec Mon Sep 17 00:00:00 2001 From: "ted.mielczarek%gmail.com" Date: Tue, 4 Sep 2007 20:38:38 +0000 Subject: [PATCH] bug 389550 - SetupExtraData should create Crash Reports dir if it doesn't exist. r=bsmedberg --- toolkit/crashreporter/nsExceptionHandler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 657576b5814..5d7a7452177 100755 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -578,6 +578,15 @@ nsresult SetupExtraData(nsILocalFile* aAppDataDirectory, rv = dataDirectory->Append(NS_LITERAL_STRING("Crash Reports")); NS_ENSURE_SUCCESS(rv, rv); + PRBool exists; + rv = dataDirectory->Exists(&exists); + NS_ENSURE_SUCCESS(rv, rv); + + if (!exists) { + rv = dataDirectory->Create(nsIFile::DIRECTORY_TYPE, 0600); + NS_ENSURE_SUCCESS(rv, rv); + } + nsCAutoString data; if(NS_SUCCEEDED(GetOrInit(dataDirectory, NS_LITERAL_STRING("UserID"), data, InitUserID)))