From 428f764577fc01ebbd06affdc1829a564f78dfc3 Mon Sep 17 00:00:00 2001 From: InHong Han Date: Tue, 5 Dec 2017 20:10:15 +0900 Subject: [PATCH] Add error log when creating the scim directory Change-Id: I246af4f773dfe1a178be371267c7c65232e1ea3f (cherry picked from commit 2582cddc9f1764692f8bbc900a9e66ed7e177e0a) --- ism/src/scim_utility.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ism/src/scim_utility.cpp b/ism/src/scim_utility.cpp index 68e2a89..002881c 100644 --- a/ism/src/scim_utility.cpp +++ b/ism/src/scim_utility.cpp @@ -659,7 +659,7 @@ scim_get_home_dir () if (result && pw.pw_dir) { home_dir = pw.pw_dir; } else { - LOGD ("Fail to getpwuid_r"); + LOGE ("Fail to getpwuid_r"); } if (!home_dir) { @@ -797,14 +797,21 @@ scim_make_dir (const String &dir) //Make the dir if it's not exist. if (access (path.c_str (), R_OK) != 0) { - if (mkdir (path.c_str (), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) + if (mkdir (path.c_str (), S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) != 0) { + LOGE ("Can not create %s", path.c_str ()); return false; + } - if (access (path.c_str (), R_OK) != 0) + if (access (path.c_str (), R_OK) != 0) { + LOGE ("Can not access %s", path.c_str ()); return false; - } + } + } else + LOGE ("Can not access %s", path.c_str ()); } } + else + LOGE ("Can not access %s", dir.c_str ()); return true; } -- 2.7.4