Change exit method 26/295826/3
authorChanggyu Choi <changyu.choi@samsung.com>
Fri, 14 Jul 2023 07:55:18 +0000 (16:55 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Fri, 14 Jul 2023 08:03:33 +0000 (17:03 +0900)
When a app-defined-loader failed app launch, it is exited using exit().
But in some cases, the loader process becomes deadlocked due to sub thread resources.
This patch changes exit method to _exit().

Change-Id: Ibabf46e1ba58b596197ab71b479b6d2af02591b8
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/app-defined-loader/app-defined-loader.cc

index 92fff33..01e73e0 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/limits.h>
 #include <stdint.h>
 #include <stdio.h>
+#include <stdlib.h>
 
 #include <memory>
 #include <vector>
@@ -153,7 +154,7 @@ class AppDefinedLoader {
     int ret = launchpad::Plugin::PrepareApp("", ex);
     if (ret != 0) {
       _E("Plugin::PrepareApp() is failed. error(%d)", ret);
-      exit(EXIT_FAILURE);
+      _exit(EXIT_FAILURE);
     }
   }
 
@@ -190,7 +191,7 @@ class AppDefinedLoader {
       if (execv(argv_[0], argv_) < 0) {
         fprintf(stderr, "Failed to execute a file. path: %s, errno: %d(%s)\n",
             argv_[0], errno, strerror_r(errno, err_str, sizeof(err_str)));
-        exit(EXIT_FAILURE);
+        _exit(EXIT_FAILURE);
       }
     }
   }