+ if (is_default_open) {
+ int retry_count = 0;
+ int ret = -1;
+ do {
+ ret = xmlSaveFile(STT_CONFIG, g_config_doc);
+ if (0 < ret)
+ break;
+ retry_count++;
+ usleep(10000);
+
+ if (STT_RETRY_COUNT == retry_count) {
+ SLOG(LOG_ERROR, stt_tag(), "[ERROR] Save result : %d", ret);
+ return -1;
+ }
+ } while (0 != ret);
+
+ /* Set mode */
+ if (0 > chmod(STT_CONFIG, 0600)) {
+ SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to change file mode : %d", ret);
+ }
+
+ /* Set owner */
+ if (0 > chown(STT_CONFIG, 5000, 5000)) {
+ SLOG(LOG_ERROR, stt_tag(), "[ERROR] Fail to change file owner : %d", ret);
+ }
+ SLOG(LOG_DEBUG, stt_tag(), "Default config is changed : pid(%d)", getpid());
+ }