]> Chaos Git - corbenik/ctrulib.git/commitdiff
Minor APT behaviour change
authorfincs <fincs.alt1@gmail.com>
Wed, 13 May 2015 12:10:25 +0000 (14:10 +0200)
committerfincs <fincs.alt1@gmail.com>
Wed, 13 May 2015 12:10:25 +0000 (14:10 +0200)
libctru/source/services/apt.c

index c4de7d4ff6b5ebc7703096c8972c5d96bdb556a0..01754d59c830acf889c5d5482768e8155ae6b16a 100644 (file)
@@ -55,14 +55,14 @@ __attribute__((weak)) void _aptDebug(int a, int b)
 
 static void aptAppStarted(void);
 
-static bool aptIsCrippled(void)
+static bool aptIsReinit(void)
 {
-       return (__system_runflags & RUNFLAG_APTWORKAROUND) != 0;
+       return (__system_runflags & RUNFLAG_APTREINIT) != 0;
 }
 
-static bool aptIsReinit(void)
+static bool aptIsCrippled(void)
 {
-       return (__system_runflags & RUNFLAG_APTREINIT) != 0;
+       return (__system_runflags & RUNFLAG_APTWORKAROUND) != 0 && !aptIsReinit();
 }
 
 static Result __apt_initservicehandle()
@@ -510,7 +510,7 @@ void aptExit()
        if(!aptIsCrippled())
        {
                bool isReinit = aptIsReinit();
-               if (aptGetStatus() == APP_EXITING)
+               if (aptGetStatus() == APP_EXITING || !isReinit)
                {
                        aptOpenSession();
                        APT_PrepareToCloseApplication(NULL, 0x1);