Make ScopedAppLauncher child always notify the parent
[platform/core/test/security-tests.git] / src / security-manager-tests / common / scoped_app_launcher.cpp
index a557f01..50a9587 100644 (file)
@@ -34,11 +34,15 @@ ScopedAppLauncher::ScopedAppLauncher(const AppInstallHelper& app) :
     } else {
         m_syncPipe.claimChildEp();
 
-        RUNNER_ASSERT_ERRNO_MSG(setLauncherSecurityAttributes(app.getUID(), app.getGID()) == 0,
-                                "launcher failed");
-        Api::prepareAppCandidate();
-        Api::prepareApp(app.getAppId().c_str());
-
+        try {
+            RUNNER_ASSERT_ERRNO_MSG(setLauncherSecurityAttributes(app.getUID(), app.getGID()) == 0,
+                                    "launcher failed");
+            Api::prepareAppCandidate();
+            Api::prepareApp(app.getAppId().c_str());
+        } catch (...) {
+            m_syncPipe.post();
+            throw;
+        }
         m_syncPipe.post();
         m_syncPipe.wait();
         exit(0);