Add Flag to unload plugin only once 89/266289/1 accepted/tizen/6.5/unified/20211111.115701 submit/tizen_6.5/20211110.130924
authormanish.r <manish.r@samsung.com>
Wed, 10 Nov 2021 08:26:33 +0000 (13:56 +0530)
committerManish Rathod <manish.r@samsung.com>
Wed, 10 Nov 2021 08:28:03 +0000 (08:28 +0000)
Change-Id: I9fadc1fc5a8bcbfefadfbd8e4cab0ec5d78f1e35
Signed-off-by: manish.r <manish.r@samsung.com>
src/file_sync_service.c
src/sdb.c
src/sdb.h [changed mode: 0644->0755]

index 2ab73c1..f179a61 100755 (executable)
@@ -605,10 +605,12 @@ void file_sync_service(int fd, void *cookie)
 
     if (pid == 0) {
         sdb_close(s[0]); //close the parent fd
+        exit_cleanup_required = 0;
         sync_read_label_notify(s[1]);
         _exit(0);
     } else if (pid > 0) {
         sdb_close(s[1]);
+        exit_cleanup_required = 1;
 
         char *buffer = malloc(SYNC_DATA_MAX);
         if(buffer == NULL) {
index 06ad083..7b79f52 100755 (executable)
--- a/src/sdb.c
+++ b/src/sdb.c
@@ -72,6 +72,7 @@ SDB_MUTEX_DEFINE( D_lock );
 #define SDB_LOGCONF_PATH "/tmp/.sdbdlog.conf"
 
 int HOST = 0;
+int exit_cleanup_required = 0;
 
 // sdk user
 uid_t g_sdk_user_id;
@@ -1222,7 +1223,10 @@ static void sdb_cleanup(void)
 
 static void sdb_service_cleanup(void)
 {
-    unload_sdbd_service_plugin();
+    if (exit_cleanup_required)
+    {
+        unload_sdbd_service_plugin();
+    }
 }
 
 
old mode 100644 (file)
new mode 100755 (executable)
index b3c7820..1e51745
--- a/src/sdb.h
+++ b/src/sdb.h
@@ -527,4 +527,5 @@ void get_env(char *key, char **env);
 #define RESERVE_CAPABILITIES_AFTER_FORK 0
 #define DROP_CAPABILITIES_AFTER_FORK 1
 
+extern int exit_cleanup_required;
 #endif