aboutsummaryrefslogtreecommitdiff
path: root/src/qt_common/util/content.cpp
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-05-13 19:14:59 +0200
committercrueter <crueter@eden-emu.dev>2026-05-13 19:14:59 +0200
commitee188168c12188340961314e1dfc70a4f7ad4f7a (patch)
tree5922424fc6ece71efddf2db427b2e7cb18a3c226 /src/qt_common/util/content.cpp
parent1f558ce9b3ae5feb5c56dbc1fe9825cfb8470f05 (diff)
[common] do not crash when don't have permissions to /tmp/eden directory due to unforessen circumstances (FreeBSD) (#3912)
instead of throwing, use std::error_code and such due to reasons unberknownst to me, the UID of the /tmp/eden directory was set for another user, this inevitably caused a crash due to wrong permissions (which is a very user unfriendly thing to do generally) Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3912 Reviewed-by: crueter <crueter@eden-emu.dev>
Diffstat (limited to 'src/qt_common/util/content.cpp')
-rw-r--r--src/qt_common/util/content.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/qt_common/util/content.cpp b/src/qt_common/util/content.cpp
index 4d9b324608..f705b3e00f 100644
--- a/src/qt_common/util/content.cpp
+++ b/src/qt_common/util/content.cpp
@@ -181,15 +181,13 @@ void InstallFirmware(const QString& location, bool recursive) {
QString UnzipFirmwareToTmp(const QString& location) {
namespace fs = std::filesystem;
- fs::path tmp{fs::temp_directory_path()};
-
- if (!fs::create_directories(tmp / "eden" / "firmware")) {
+ fs::path tmp{fs::temp_directory_path() / "eden" / "firmware"};
+ std::error_code ec;
+ fs::remove_all(tmp, ec);
+ if (!fs::create_directories(tmp, ec)) {
return QString();
}
- tmp /= "eden";
- tmp /= "firmware";
-
QString qCacheDir = QString::fromStdString(tmp.string());
QFile zip(location);