xmlChar *key = NULL;
xmlChar *attr = NULL;
- doc = xmlParseFile(path);
- if (doc == NULL) {
- SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to parse xml file");
+ if (0 == access(path, F_OK)) {
+ SLOG(LOG_DEBUG, tts_tag(), "[DEBUG] Success to access to %s", path);
+ doc = xmlParseFile(path);
+ if (doc == NULL) {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to parse xml file");
+ return -1;
+ }
+ } else {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to access to %s", path);
return -1;
}
}
xmlDocPtr doc = NULL;
- doc = xmlParseFile(original);
- if (doc == NULL) {
- SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to parse file error : %s", original);
+ if (0 == access(original, F_OK)) {
+ SLOG(LOG_DEBUG, tts_tag(), "[DEBUG] Success to access to %s", original);
+ doc = xmlParseFile(original);
+ if (doc == NULL) {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to parse file error : %s", original);
+ return -1;
+ }
+ } else {
+ SLOG(LOG_ERROR, tts_tag(), "[ERROR] Fail to access to %s", original);
return -1;
}
int retry_count = 0;
while (NULL == doc) {
- doc = xmlParseFile(TTS_CONFIG);
- if (NULL != doc) {
- break;
+ if (0 == access(TTS_CONFIG, F_OK)) {
+ SLOG(LOG_DEBUG, tts_tag(), "[DEBUG] Success to access to %s", TTS_CONFIG);
+ doc = xmlParseFile(TTS_CONFIG);
+ if (NULL != doc) {
+ break;
+ }
}
retry_count++;
usleep(10000);