Skip to content

Commit e33faa9

Browse files
committed
es: reset ISFS when calling ES_SetUID
thanks to ThePikachuGamer for pointing it out
1 parent 04f5abb commit e33faa9

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

libogc/es.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ distribution.
4343
#include "processor.h"
4444
#include "mutex.h"
4545
#include "es.h"
46+
#include "isfs.h"
4647

4748
//#define DEBUG_ES
4849

@@ -194,7 +195,16 @@ s32 ES_SetUID(u64 uid)
194195
{
195196
if(__es_fd<0) return ES_ENOTINIT;
196197

197-
return IOS_IoctlvFormat(__es_hid,__es_fd,IOCTL_ES_SETUID,"q:",uid);
198+
s32 ret = IOS_IoctlvFormat(__es_hid,__es_fd,IOCTL_ES_SETUID,"q:",uid);
199+
200+
//if the call succeeded, our FS handle needs to be reopened, as IOS saves access of our FD
201+
if(ret >= 0)
202+
{
203+
ISFS_Deinitialize();
204+
ISFS_Initialize();
205+
}
206+
207+
return ret;
198208
}
199209

200210
s32 ES_GetDataDir(u64 titleID,char *filepath)

0 commit comments

Comments
 (0)