static void __get_engine_list(const char* directory)
{
DIR *dp = NULL;
- int ret = -1;
- struct dirent entry;
struct dirent *dirp = NULL;
if (NULL == directory) {
SLOG(LOG_ERROR, stt_tag(), "[Directory ERROR] Directory is NULL");
return;
+ } else {
+ SLOG(LOG_DEBUG, stt_tag(), "[Directory DEBUG] Directory: %s", directory);
}
dp = opendir(directory);
if (NULL != dp) {
do {
- ret = readdir_r(dp, &entry, &dirp);
- if (0 != ret) {
- SLOG(LOG_ERROR, stt_tag(), "[File ERROR] Fail to read directory");
- break;
- }
+ dirp = readdir(dp);
if (NULL != dirp) {
if (!strcmp(".", dirp->d_name) || !strcmp("..", dirp->d_name))
char* filepath = NULL;
int filesize;
- filesize = strlen(STT_DEFAULT_ENGINE_INFO) + strlen(dirp->d_name) + 5;
+ filesize = strlen(directory) + strlen(dirp->d_name) + 5;
filepath = (char*)calloc(filesize, sizeof(char));
if (NULL != filepath) {
continue;
}
+ SLOG(LOG_DEBUG, stt_tag(), "[File DEBUG] File path: %s", filepath);
+
if (0 == stt_parser_get_engine_info(filepath, &info)) {
g_engine_list = g_slist_append(g_engine_list, info);
}
SLOG(LOG_ERROR, stt_tag(), "[DBUS-BUXTON2] Fail to open buxton client, ret(%d)", ret);
return STT_CONFIG_ERROR_OPERATION_FAILED;
}
- bux_layer = buxton_create_layer("user");
+ bux_layer = buxton_create_layer("system");
if (NULL == bux_layer) {
SLOG(LOG_ERROR, stt_tag(), "[DBUS-BUXTON2] buxton_create_layer FAIL");
buxton_close(bux_cli);