mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-08-21 07:18:33 +00:00
[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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user