Skip to content

Commit

Permalink
Merge pull request #1679 from contour-terminal/improvement/warn-on-xd…
Browse files Browse the repository at this point in the history
…g-fs-rror

[contour] Do not abort when failing to create `XDG_STATE_HOME/contour/crash` directory
  • Loading branch information
christianparpart authored Dec 27, 2024
2 parents e2e76af + e76bcb6 commit a6b9d40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<release version="0.6.1" urgency="medium" type="development">
<description>
<ul>
<li> ... </li>
<li>Do not abort when failing to create `XDG_STATE_HOME/contour/crash` directory</li>
</ul>
</description>
</release>
Expand Down
7 changes: 6 additions & 1 deletion src/contour/ContourApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,13 @@ ContourApp::ContourApp(): app("contour", "Contour Terminal Emulator", CONTOUR_VE

#if defined(__linux__)
auto crashLogDirPath = crispy::app::instance()->localStateDir() / "crash";
std::filesystem::create_directories(crashLogDirPath);
crashLogDir = crashLogDirPath.string();
auto errorCode = std::error_code {};
std::filesystem::create_directories(crashLogDirPath, errorCode);
if (errorCode)
std::cerr << std::format("Warning: Failed to create crash log directory: {} ({})\n",
errorCode.message(),
errorCode.category().name());
// signal(SIGSEGV, segvHandler);
signal(SIGABRT, segvHandler);
#endif
Expand Down

0 comments on commit a6b9d40

Please sign in to comment.