Skip to content

Commit

Permalink
Revert "Merge pull request ps2dev#682 from uyjulian/iomanx_use_device…
Browse files Browse the repository at this point in the history
…_for_check"

This reverts commit 0fa8842, reversing
changes made to 89d7ece.
  • Loading branch information
fjtrujy committed Nov 28, 2024
1 parent 0fa8842 commit e730cf2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions iop/system/iomanx/src/iomanX.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,16 @@ static inline void handle_result_pre(int in_result, iomanX_iop_file_t *f, int op
{
if ( f )
{
// Unofficial: don't clear mode
f->mode = 0;
f->device = NULL;
}
}
if ( (op & HANDLE_RESULT_CLEAR_INFO_ON_ERROR) )
{
if ( f && (in_result < 0) )
{
// Unofficial: also clear mode
f->mode = 0;
f->device = NULL;
}
}
Expand Down Expand Up @@ -964,13 +966,13 @@ static iomanX_iop_file_t *new_iob(void)

CpuSuspendIntr(&state);
file_table_entry = file_table;
while ( (file_table_entry < &file_table[sizeof(file_table) / sizeof(file_table[0])]) && file_table_entry->device )
while ( (file_table_entry < &file_table[sizeof(file_table) / sizeof(file_table[0])]) && file_table_entry->mode )
file_table_entry += 1;
if ( file_table_entry >= &file_table[sizeof(file_table) / sizeof(file_table[0])] )
file_table_entry = NULL;
// fill in "device" temporarily to mark the fd as allocated.
// fill in "mode" temporarily to mark the fd as allocated.
if ( file_table_entry )
file_table_entry->device = (iomanX_iop_device_t *)(uiptr)0xFFFFFFEC;
file_table_entry->mode = -20;
CpuResumeIntr(state);
if ( !file_table_entry )
_ioabort("out of file descriptors", "[too many open]");
Expand Down

0 comments on commit e730cf2

Please sign in to comment.