summaryrefslogtreecommitdiff
path: root/src/persistence_client_library.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/persistence_client_library.c')
-rw-r--r--src/persistence_client_library.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/persistence_client_library.c b/src/persistence_client_library.c
index 0608539..70fe20e 100644
--- a/src/persistence_client_library.c
+++ b/src/persistence_client_library.c
@@ -24,6 +24,7 @@
#include "persistence_client_library_handle.h"
#include "persistence_client_library_custom_loader.h"
#include "persistence_client_library.h"
+#include "persistence_client_library_backup_filelist.h"
#include <string.h>
#include <errno.h>
@@ -40,6 +41,10 @@
/// debug log and trace (DLT) setup
DLT_DECLARE_CONTEXT(gDLTContext);
+// declared in persistence_client_library_dbus_service.c
+// used to end dbus library
+extern int bContinue;
+
static int gShutdownMode = 0;
/// loical function declaration
@@ -66,11 +71,26 @@ int pclInitLibrary(const char* appName, int shutdownMode)
/// environment variable for max key value data
const char *pDataSize = getenv("PERS_MAX_KEY_VAL_DATA_SIZE");
+ /// blacklist path environment variable
+ const char *pBlacklistPath = getenv("PERS_BLACKLIST_PATH");
+
if(pDataSize != NULL)
{
gMaxKeyValDataSize = atoi(pDataSize);
}
+ if(pBlacklistPath != NULL)
+ {
+ pBlacklistPath = "/etc/pclBackupBlacklist.txt"; // default path
+ }
+
+ rval = readBlacklistConfigFile(pBlacklistPath);
+ if(rval == -1)
+ {
+ DLT_LOG(gDLTContext, DLT_LOG_WARN, DLT_STRING("pclInitLibrary -> failed to access blacklist:"), DLT_STRING(pBlacklistPath));
+ }
+
+
if( setup_dbus_mainloop() == -1)
{
DLT_LOG(gDLTContext, DLT_LOG_ERROR, DLT_STRING("pclInitLibrary => Failed to setup main loop"));
@@ -140,7 +160,6 @@ int pclInitLibrary(const char* appName, int shutdownMode)
DLT_LOG(gDLTContext, DLT_LOG_WARN, DLT_STRING("pclInit => Failed to load custom library config table => error number:"), DLT_INT(status));
}
-
// assign application name
strncpy(gAppId, appName, MaxAppNameLen);
gAppId[MaxAppNameLen-1] = '\0';
@@ -148,8 +167,6 @@ int pclInitLibrary(const char* appName, int shutdownMode)
// destory mutex
pthread_mutex_destroy(&gDbusInitializedMtx);
pthread_cond_destroy(&gDbusInitializedCond);
-
- rval = 1;
}
else if(gPclInitialized >= PCLinitialized)
{
@@ -203,10 +220,14 @@ int pclDeinitLibrary(void)
gPclInitialized--; // decrement init counter
}
+ // end dbus library
+ bContinue = FALSE;
+
return rval;
}
+
void invalidateCustomPlugin(int idx)
{
gPersCustomFuncs[idx].handle = NULL;