7z: log error code when opening the file

This commit is contained in:
Megamouse 2025-03-30 12:07:28 +02:00
parent cd840ef70a
commit cd9c156937

View file

@ -504,9 +504,9 @@ bool update_manager::handle_rpcs3(const QByteArray& data, bool auto_accept)
ISzAlloc allocImp = g_Alloc;
ISzAlloc allocTempImp = g_Alloc;
if (InFile_Open(&archiveStream.file, tmpfile_path.c_str()))
if (const WRes res = InFile_Open(&archiveStream.file, tmpfile_path.c_str()))
{
update_log.error("Failed to open temporary storage file: %s", tmpfile_path);
update_log.error("Failed to open temporary storage file: '%s' (error=%d)", tmpfile_path, static_cast<u64>(res));
return false;
}
@ -534,7 +534,8 @@ bool update_manager::handle_rpcs3(const QByteArray& data, bool auto_accept)
SzArEx_Free(&db, &allocImp);
ISzAlloc_Free(&allocImp, lookStream.buf);
File_Close(&archiveStream.file);
const WRes res2 = File_Close(&archiveStream.file);
if (res2) update_log.warning("7z failed to close file (error=%d)", static_cast<u64>(res2));
switch (res)
{