Add error log when creating the scim directory 07/162907/1
authorInHong Han <inhong1.han@samsung.com>
Tue, 5 Dec 2017 11:10:15 +0000 (20:10 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 6 Dec 2017 06:35:27 +0000 (06:35 +0000)
Change-Id: I246af4f773dfe1a178be371267c7c65232e1ea3f
(cherry picked from commit 2582cddc9f1764692f8bbc900a9e66ed7e177e0a)

ism/src/scim_utility.cpp

index 68e2a89..002881c 100644 (file)
@@ -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;
 }