Fix sort condition 33/302033/2
authorChanggyu Choi <changyu.choi@samsung.com>
Thu, 30 Nov 2023 01:48:17 +0000 (10:48 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Thu, 30 Nov 2023 01:59:05 +0000 (10:59 +0900)
Change-Id: Ia31f79cf645d9acae6c5f300b45ec8140a1bcd4a
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/lib/boot_sequencer/boot_sequencer.cc

index a263d29..4864af1 100644 (file)
@@ -432,12 +432,12 @@ void BootSequencer::QueueSort() {
         int ret = -1;
         if (a->AfterContains(b->GetAppId()) ||
             a->RequiresContains(b->GetAppId()))
-          ret = 1;
+          ret = 0;
 
         if (b->AfterContains(a->GetAppId()) ||
             b->RequiresContains(a->GetAppId())) {
           if (ret == -1) {
-            ret = 0;
+            ret = 1;
           } else {
             _E("Circular dependencies");
             ret = -1;
@@ -445,7 +445,7 @@ void BootSequencer::QueueSort() {
         }
 
         if (ret == -1)
-          ret = a->GetPriority() > b->GetPriority() ? 0 : 1;
+          ret = a->GetPriority() > b->GetPriority() ? 1 : 0;
 
         _W("%s : %s : %d", a->GetAppId().c_str(), b->GetAppId().c_str(), ret);
         return ret == 1 ? true : false;