X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=common%2Fstt_config_mgr.c;h=f5ba157ca4bf8b4b6c8ee8d5501cda1a7f9bba3a;hb=97ec8f067306caecf6bc7275ee58b92eb4f60c0f;hp=c9b787065b315175d5b8e62fa2cacd70bf052dd1;hpb=74b613423ff4a4899e22a7518ff2802cb489caac;p=platform%2Fcore%2Fuifw%2Fstt.git diff --git a/common/stt_config_mgr.c b/common/stt_config_mgr.c index c9b7870..f5ba157 100644 --- a/common/stt_config_mgr.c +++ b/common/stt_config_mgr.c @@ -750,6 +750,48 @@ int stt_config_mgr_initialize(int uid) return STT_CONFIG_ERROR_NONE; } + /* Make directories */ + if (0 != access(STT_CONFIG_BASE, F_OK)) { + if (0 != mkdir(STT_CONFIG_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { + SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to make directory : %s", STT_CONFIG_BASE); + __stt_config_release_client(uid); + return STT_CONFIG_ERROR_OPERATION_FAILED; + } else { + SLOG(LOG_DEBUG, stt_tag(), "Success to make directory : %s", STT_CONFIG_BASE); + } + } + + if (0 != access(STT_HOME, F_OK)) { + if (0 != mkdir(STT_HOME, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { + SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to make directory : %s", STT_HOME); + __stt_config_release_client(uid); + return STT_CONFIG_ERROR_OPERATION_FAILED; + } else { + SLOG(LOG_DEBUG, stt_tag(), "Success to make directory : %s", STT_HOME); + } + } + + if (0 != access(STT_DOWNLOAD_BASE, F_OK)) { + if (0 != mkdir(STT_DOWNLOAD_BASE, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { + SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to make directory : %s", STT_DOWNLOAD_BASE); + __stt_config_release_client(uid); + return STT_CONFIG_ERROR_OPERATION_FAILED; + } else { + SLOG(LOG_DEBUG, stt_tag(), "Success to make directory : %s", STT_DOWNLOAD_BASE); + } + } + + if (0 != access(STT_DOWNLOAD_ENGINE_INFO, F_OK)) { + if (0 != mkdir(STT_DOWNLOAD_ENGINE_INFO, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)) { + SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to make directory : %s", STT_DOWNLOAD_ENGINE_INFO); + __stt_config_release_client(uid); + return STT_CONFIG_ERROR_OPERATION_FAILED; + } else { + SLOG(LOG_DEBUG, stt_tag(), "Success to make directory : %s", STT_DOWNLOAD_ENGINE_INFO); + } + } + + /* Get file name from default engine directory */ g_engine_list = NULL; @@ -1604,9 +1646,13 @@ int stt_config_mgr_add_time_info(int index, int event, const char* text, long st info->start_time = start_time; info->end_time = end_time; + SLOG(LOG_DEBUG, stt_tag(), "[DEBUG] inside stt_config_mgr_add_time_info: index(%d), text(%s), start time(%d), end_time(%d)", info->index, (NULL == info->text) ? "NULL" : info->text, info->start_time, info->end_time); + /* Add item to global list */ g_time_list = g_slist_append(g_time_list, info); + SLOG(LOG_DEBUG, stt_tag(), "[DEBUG] inside stt_config_mgr_add_time_info: g_time_list length(%d)", g_slist_length(g_time_list)); + return 0; }