Popup removal 2
[framework/web/wrt-installer.git] / src / wrt-installer / plugin_utils.cpp
index 3b25cb6..5368f3f 100644 (file)
@@ -20,6 +20,7 @@
  * @brief   Header file for plugin util
  */
 
+#include <unistd.h>
 #include "plugin_utils.h"
 #include <dpl/exception.h>
 #include <dpl/log/log.h>
@@ -33,8 +34,13 @@ const char* PLUGIN_INSTALL_LOCK_FILE = "/tmp/.wrt_plugin_install_lock";
 
 static int s_plugin_install_lock_fd = -1;
 
-bool lockPluginInstallation()
+bool lockPluginInstallation(bool isPreload)
 {
+    if (isPreload) {
+        fprintf(stderr, "Skip create lock file.. \n");
+        return true;
+    }
+
     int ret = 0;
 
     LogInfo("Try to lock for plugins installation.");
@@ -62,9 +68,13 @@ bool lockPluginInstallation()
     return true;
 }
 
-bool unlockPluginInstallation()
+bool unlockPluginInstallation(bool isPreload)
 {
     LogInfo("Unlock for plugins installation.");
+    if (isPreload) {
+        fprintf(stderr, "Skip plugin unlock.. \n");
+        return true;
+    }
 
     if (s_plugin_install_lock_fd != -1) {
         int ret = 0;