tts_personal_info_s* info = NULL;
int ret = tts_parser_get_personal_info(filepath, &info);
if (0 != ret) {
- return -1;
+ if (ENOENT == ret) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] There is no personal xml file");
+ return TTS_CONFIG_ERROR_NONE;
+ }
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to get personal information");
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
}
GSList *iter_personal_voice = NULL;
tts_parser_free_personal_info(info);
- return 0;
+ return TTS_CONFIG_ERROR_NONE;
}
int __tts_config_mgr_print_engine_info()
tts_personal_info_s* info = NULL;
ret = tts_parser_get_personal_info(filepath, &info);
if (0 != ret) {
+ if (ENOENT == ret) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] There is no personal xml file");
+ return TTS_CONFIG_ERROR_NONE;
+ }
SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to get personal information");
return TTS_CONFIG_ERROR_OPERATION_FAILED;
}
tts_personal_info_s* info = NULL;
int ret = tts_parser_get_personal_info(filepath, &info);
if (0 != ret) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] There is no personal info file. It can be first time or fail.");
- return 0;
+ if (ENOENT == ret) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] There is no personal xml file");
+ return TTS_CONFIG_ERROR_NONE;
+ }
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] Fail to get personal information");
+ return TTS_CONFIG_ERROR_OPERATION_FAILED;
}
GSList *iter_personal_voice = NULL;
}
tts_parser_free_personal_info(info);
- return 0;
+ return TTS_CONFIG_ERROR_NONE;
}
\ No newline at end of file
xmlNodePtr cur = NULL;
struct stat sb;
- int ret = stat(path, &sb);
- if (0 != ret) {
- SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] There is no personal xml file");
- return 0;
+ if (stat(path, &sb) == -1) {
+ if (errno == ENOENT) {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] There is no personal xml file");
+ return ENOENT;
+ } else {
+ SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] stat error");
+ return -1;
+ }
}
if (0 == access(path, F_OK)) {