if (ppList) {
for (i = 0; i < size; ++i) {
- if (ppList[i]) {
+ if (ppList[i])
free(ppList[i]);
- }
- }
- if (ppList) {
- free(ppList);
}
+ free(ppList);
}
}
LOGD("PKGMGR_PARSER_PLUGIN_INSTALL() called with [%s].", packageId);
uid_t user_id = getuid();
- LOGD("Current userid is %d.", user_id);
+ LOGD("user_id is %d.", user_id);
int ret = 0;
LOGE("Failed to get the element. xmlFirstElementChild() returned NULL.");
return -EINVAL;
}
+
curPtr = curPtr->xmlChildrenNode;
if (curPtr == NULL) {
LOGE("No privileges");
curPtr = curPtr->next;
}
- char** ppPrivilegeList = (char**) calloc(privilegeList.size() + 1, sizeof(char*));
- char** temp = ppPrivilegeList;
+ char **ppPrivilegeList = (char**) calloc(privilegeList.size() + 1, sizeof(char*));
+ char **temp = ppPrivilegeList;
std::list <std::string>::iterator iter = privilegeList.begin();
for (size_t i = 0; i < privilegeList.size(); ++i) {
ppPrivilegeList[i] = (char*)calloc(strlen(iter->c_str()) + 1, sizeof(char));
#include "PrivacyIdInfo.h"
#define BUF_SIZE 256
+#define ONE_SEC (SLEEP_TIME * 20)
static cynara_monitor_configuration *p_conf;
static cynara_monitor *p_cynara_monitor;
int
CynaraService::initialize(void)
{
- PG_LOGD("[cynara_service] CynaraService initializing");
+ PG_LOGD("initializing CynaraService..");
int res = cynara_monitor_configuration_create(&p_conf);
if(res != CYNARA_API_SUCCESS){
int
CynaraService::start(void)
{
- PG_LOGI("[cynara_service] CynaraService starting");
+ PG_LOGI("starting CynaraService..");
int res = 0;
char buf[256];
void*
CynaraService::getEntriesThread(void* pData)
{
- PG_LOGD("[cynara_service] Running get entries thread");
+ PG_LOGD("Running get entries thread");
int res = -1;
PG_LOGD("ok, i'm wakeup..");
pthread_mutex_unlock(&g_mutex);
#else
- usleep(SLEEP_TIME * 20); // 1 SEC
+ usleep(ONE_SEC); // 1 SEC
#endif
} else {
if (monitor_entries) {
PG_LOGD("calling pSocketService->stop()");
pSocketService->stop();
-// PG_LOGD("calling pCynaraService->stop()");
-// pCynaraService->stop();
+ PG_LOGD("calling pCynaraService->stop()");
+ pCynaraService->stop();
return 0;
}
{
PG_LOGD("calling pSocketService->shutdown()");
pSocketService->shutdown();
-// PG_LOGD("calling pCynaraService->shutdown()");
-// pCynaraService->shutdown();
+
+ PG_LOGD("calling pCynaraService->shutdown()");
+ pCynaraService->shutdown();
return 0;
}
#include <sstream>
#include <fstream>
#include <sqlite3.h>
-#include <pkgmgr-info.h>
#include <time.h>
#include <privilege_info.h>
#include <cynara-monitor.h>