mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-04-04 22:19:02 +00:00
Make gamedata installation atomic as real PS3
This commit is contained in:
parent
a9b0d25c01
commit
d7b4753007
6 changed files with 123 additions and 11 deletions
|
|
@ -907,19 +907,16 @@ struct fs_aio_thread : ppu_thread
|
|||
const auto func = cmd2.arg2<fs_aio_cb_t>();
|
||||
cmd_pop(1);
|
||||
|
||||
s32 error = CELL_OK;
|
||||
s32 error = CELL_EBADF;
|
||||
u64 result = 0;
|
||||
|
||||
const auto file = idm::get<lv2_fs_object, lv2_file>(aio->fd);
|
||||
|
||||
if (!file || (type == 1 && file->flags & CELL_FS_O_WRONLY) || (type == 2 && !(file->flags & CELL_FS_O_ACCMODE)))
|
||||
{
|
||||
error = CELL_EBADF;
|
||||
}
|
||||
else
|
||||
else if (std::lock_guard lock(file->mp->mutex); file->file)
|
||||
{
|
||||
std::lock_guard lock(file->mp->mutex);
|
||||
|
||||
const auto old_pos = file->file.pos(); file->file.seek(aio->offset);
|
||||
|
||||
result = type == 2
|
||||
|
|
@ -927,6 +924,7 @@ struct fs_aio_thread : ppu_thread
|
|||
: file->op_read(aio->buf, aio->size);
|
||||
|
||||
file->file.seek(old_pos);
|
||||
error = CELL_OK;
|
||||
}
|
||||
|
||||
func(*this, aio, error, xid, result);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue