tmp = strrchr(package, '.');
if(tmp == NULL) {
- _E("(tmp == NULL) return\n");
+ _E("[%s] is not a desktop file", package);
free(package);
return NULL;
}
struct dirent entry, *result;
int len, ret;
char buf[BUFSZE];
+ int total_cnt = 0;
+ int ok_cnt = 0;
// desktop file
dir = opendir(directory);
}
len = strlen(directory) + 1;
- _D("Loading desktop files from %s\n", directory);
+ _D("Loading desktop files from %s", directory);
for (ret = readdir_r(dir, &entry, &result);
ret == 0 && result != NULL;
char *package;
if (entry.d_name[0] == '.') continue;
-
+ total_cnt++;
package = _desktop_to_package(entry.d_name);
if (!package) {
- _E("Failed to convert file to package[%s]\n", entry.d_name);
+ _E("Failed to convert file to package[%s]", entry.d_name);
continue;
}
if (ail_desktop_add(package) != AIL_ERROR_OK) {
- _E("Failed to add a package[%s]\n", package);
+ _E("Failed to add a package[%s]", package);
+ } else {
+ ok_cnt++;
}
-
free(package);
}
+ _D("Application-Desktop process : Success [%d], fail[%d], total[%d] \n", ok_cnt, total_cnt-ok_cnt, total_cnt);
closedir(dir);
return AIL_ERROR_OK;
ret = initdb_count_app();
if (ret > 0) {
_D("Some Apps in the App Info DB.");
- return AIL_ERROR_OK;
}
ret = initdb_load_directory(OPT_DESKTOP_DIRECTORY);
if (ret == AIL_ERROR_FAIL) {
_E("cannot load opt desktop directory.");
- return AIL_ERROR_FAIL;
}
ret = initdb_load_directory(USR_DESKTOP_DIRECTORY);
if (ret == AIL_ERROR_FAIL) {
_E("cannot load usr desktop directory.");
- return AIL_ERROR_FAIL;
}
ret = initdb_change_perm(APP_INFO_DB_FILE);
if (ret == AIL_ERROR_FAIL) {
_E("cannot chown.");
- return AIL_ERROR_FAIL;
}
const char *argv_smack[] = { "/usr/bin/chsmack", "-a", APP_INFO_DB_LABEL, APP_INFO_DB_FILE, NULL };