From a41f1b3d01059840fef8af39eecab60fcd570e1c Mon Sep 17 00:00:00 2001 From: dyamy-lee Date: Wed, 25 Sep 2024 16:52:52 +0900 Subject: [PATCH] add printing errno In tts_parser_get_personal_info(), it can show the result of errno Change-Id: I1ab75f45a954475e9dbe125d93ffd0acb1bba124 --- common/tts_config_parser.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/tts_config_parser.c b/common/tts_config_parser.c index b0112251..8bbeec80 100644 --- a/common/tts_config_parser.c +++ b/common/tts_config_parser.c @@ -260,11 +260,12 @@ int tts_parser_get_personal_info(const char* path, tts_personal_info_s** persona struct stat sb; if (stat(path, &sb) == -1) { - if (errno == ENOENT) { + int err = errno; + if (ENOENT == err) { SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] There is no personal xml file"); - return ENOENT; + return err; } else { - SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] stat error"); + SLOG(LOG_ERROR, TAG_TTSCONFIG, "[ERROR] stat error(%s)", strerror(err)); return -1; } } -- 2.34.1