mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 06:51:26 +12:00
update_manager: add some logging
This commit is contained in:
parent
10e6b43a2f
commit
fa6736e69d
1 changed files with 7 additions and 3 deletions
|
@ -597,11 +597,15 @@ bool update_manager::handle_rpcs3(const QByteArray& data, bool auto_accept)
|
||||||
|
|
||||||
// Move the appimage/exe and replace with new appimage
|
// Move the appimage/exe and replace with new appimage
|
||||||
const std::string move_dest = replace_path + "_old";
|
const std::string move_dest = replace_path + "_old";
|
||||||
fs::rename(replace_path, move_dest, true);
|
if (!fs::rename(replace_path, move_dest, true))
|
||||||
|
{
|
||||||
|
// Simply log error for now
|
||||||
|
update_log.error("Failed to move old AppImage file: %s (%s)", replace_path, fs::g_tls_error);
|
||||||
|
}
|
||||||
fs::file new_appimage(replace_path, fs::read + fs::write + fs::create + fs::trunc);
|
fs::file new_appimage(replace_path, fs::read + fs::write + fs::create + fs::trunc);
|
||||||
if (!new_appimage)
|
if (!new_appimage)
|
||||||
{
|
{
|
||||||
update_log.error("Failed to create new AppImage file: %s", replace_path);
|
update_log.error("Failed to create new AppImage file: %s (%s)", replace_path, fs::g_tls_error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (new_appimage.write(data.data(), data.size()) != data.size() + 0u)
|
if (new_appimage.write(data.data(), data.size()) != data.size() + 0u)
|
||||||
|
@ -611,7 +615,7 @@ bool update_manager::handle_rpcs3(const QByteArray& data, bool auto_accept)
|
||||||
}
|
}
|
||||||
if (fchmod(new_appimage.get_handle(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == -1)
|
if (fchmod(new_appimage.get_handle(), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == -1)
|
||||||
{
|
{
|
||||||
update_log.error("Failed to chmod rwxrxrx %s", replace_path);
|
update_log.error("Failed to chmod rwxrxrx %s (%s)", replace_path, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
new_appimage.close();
|
new_appimage.close();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue