Skip to content

Commit ae1692f

Browse files
committed
make sure crashdump path exists when starting
1 parent 703e1d7 commit ae1692f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

qt-ozwdaemon/main.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void* context, bool succeeded) {
9494

9595
std::string response, error;
9696
bool success = google_breakpad::HTTPUpload::SendRequest(url, parameters, files, proxy_host, proxy_userpasswd, "", &response, NULL, &error);
97-
if (success)
97+
if (success)
9898
qWarning() << "Uploaded Crash minidump With ID: " << response.c_str();
9999
else
100100
qWarning() << "Failed to Upload Crash MiniDump in " << descriptor.path();
@@ -288,10 +288,14 @@ int main(int argc, char *argv[])
288288
if (bppath.isEmpty())
289289
bppath = QStandardPaths::standardLocations(QStandardPaths::TempLocation).at(0);
290290
qInfo() << "Using BreakPad - Crash Directory: " << bppath;
291+
/* ensure path exists */
292+
if (!QDir::exists(bppath)) {
293+
QDir::mkpath(bppath);
294+
}
291295
google_breakpad::MinidumpDescriptor descriptor(bppath.toStdString());
292296
google_breakpad::ExceptionHandler eh(descriptor, NULL, dumpCallback, static_cast<void *>(&daemon), true, -1);
293-
#else
294-
signal(SIGSEGV, backtrace);
297+
#else
298+
signal(SIGSEGV, backtrace);
295299
signal(SIGABRT, backtrace);
296300
#endif
297301

0 commit comments

Comments
 (0)