]> Chaos Git - corbenik/ctrulib.git/commitdiff
Restore service session parameter in FSUSER_Initialize()
authorfincs <fincs.alt1@gmail.com>
Wed, 16 Sep 2015 21:58:12 +0000 (23:58 +0200)
committerfincs <fincs.alt1@gmail.com>
Wed, 16 Sep 2015 21:58:12 +0000 (23:58 +0200)
libctru/include/3ds/services/fs.h
libctru/source/services/fs.c

index 17f93b6c9dbe79045d745f9a7ce8d15e88745ecd..d85f75f12b629f78115b43e32bb2fc5782b68093 100644 (file)
@@ -133,7 +133,7 @@ Handle *fsGetSessionHandle(void);
 
 FS_path FS_makePath(FS_pathType type, const char  *path);
 
-Result FSUSER_Initialize(void);
+Result FSUSER_Initialize(Handle handle);
 Result FSUSER_OpenArchive(FS_archive* archive);
 Result FSUSER_OpenDirectory(Handle* out, FS_archive archive, FS_path dirLowPath);
 Result FSUSER_OpenFile(Handle* out, FS_archive archive, FS_path fileLowPath, u32 openflags, u32 attributes);
index a2e7d3404296c1f39ba50b41e95aead2f9604c88..0bbdd7a4617f765748d86e7e7ba5c162841e9252 100644 (file)
@@ -48,7 +48,7 @@ fsInit(void)
        if (fsInitialised) return ret;
 
        if((ret=srvGetServiceHandle(&fsuHandle, "fs:USER"))!=0)return ret;
-       if(__get_handle_from_list("fs:USER")==0)ret=FSUSER_Initialize();
+       if(__get_handle_from_list("fs:USER")==0)ret=FSUSER_Initialize(fsuHandle);
 
        fsInitialised = true;
 
@@ -82,6 +82,8 @@ Handle *fsGetSessionHandle(void)
  *
  *  @returns error
  *
+ *  @param[in]  handle     fs:USER service handle
+ *
  *  @internal
  *
  *  #### Request
@@ -99,19 +101,15 @@ Handle *fsGetSessionHandle(void)
  *  1          | Result code
  */
 Result
-FSUSER_Initialize(void)
+FSUSER_Initialize(Handle handle)
 {
-       // don't run command if we got handle from the list
-       if(fsuHandle != 0 && __get_handle_from_list("fs:USER")!=0)
-               return 0;
-
        u32 *cmdbuf = getThreadCommandBuffer();
 
        cmdbuf[0] = 0x08010002;
        cmdbuf[1] = 0x20;
 
        Result ret = 0;
-       if((ret = svcSendSyncRequest(fsuHandle)))
+       if((ret = svcSendSyncRequest(handle)))
                return ret;
 
        return cmdbuf[1];