if (result && pw.pw_dir) {
home_dir = pw.pw_dir;
} else {
- LOGD ("Fail to getpwuid_r");
+ LOGE ("Fail to getpwuid_r");
}
if (!home_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;
}