mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-15 23:36:59 +02: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:
parent
1f558ce9b3
commit
ee188168c1
3 changed files with 13 additions and 14 deletions
|
|
@ -46,10 +46,10 @@ const std::string GetDataDirString(DataDir dir, const std::string &user_id)
|
|||
u64 ClearDir(DataDir dir, const std::string &user_id)
|
||||
{
|
||||
fs::path data_dir = GetDataDir(dir, user_id);
|
||||
u64 result = fs::remove_all(data_dir);
|
||||
|
||||
std::error_code ec;
|
||||
u64 result = fs::remove_all(data_dir, ec);
|
||||
// mkpath at the end just so it actually exists
|
||||
fs::create_directories(data_dir);
|
||||
fs::create_directories(data_dir, ec);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue