#include <sys/stat.h>
#include <dirent.h>
+#include <errno.h>
#include <unistd.h>
#include <unique_ptr.h>
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
err = lstat(pFilePath.get(), &fileinfo);
- TryReturn(err >= 0, false, "[osp-installer] lstat() failed, filepath = [%s]", pFilePath.get());
+ TryReturn(err >= 0, false, "[osp-installer] lstat() failed(%s), filepath = [%s]", strerror(errno), pFilePath.get());
if (S_ISLNK(fileinfo.st_mode))
{
AppLogTag(OSP_INSTALLER, "Remove(): symlink, path = [%s]", pFilePath.get());
err = unlink(pFilePath.get());
- TryReturn(err >= 0, false, "[osp-installer] unlink() failed, filepath = [%s]", pFilePath.get());
+ TryReturn(err >= 0, false, "[osp-installer] unlink() failed(%s), filepath = [%s]", strerror(errno), pFilePath.get());
}
else if (S_ISDIR(fileinfo.st_mode))
{
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
err = lstat(pFilePath.get(), &fileinfo);
- TryReturn(err >= 0, false, "[osp-installer] lstat() failed, filepath = [%s]", pFilePath.get());
+ TryReturn(err >= 0, false, "[osp-installer] lstat() failed(%s), filepath = [%s]", strerror(errno), pFilePath.get());
if (S_ISLNK(fileinfo.st_mode))
{
TryReturn(pNewPath, false, "[osp-installer] pNewPath is null");
err = symlink(pOldPath.get(), pNewPath.get());
- TryReturn(err == 0, false, "[osp-installer] symlink() is failed, oldpath = [%s], newpath = [%s]", pOldPath.get(), pNewPath.get());
+ TryReturn(err == 0, false, "[osp-installer] symlink() is failed(%s), oldpath = [%s], newpath = [%s]", strerror(errno), pOldPath.get(), pNewPath.get());
+
+ AppLogTag(OSP_INSTALLER, "CreateSymlink() [%ls] -> [%ls]", newPath.GetPointer(), oldPath.GetPointer());
return true;
}
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
err = chmod(pFilePath.get(), mode);
- TryReturn(err == 0, false, "[osp-installer] chmod() is failed, filepath = [%s], mode = [%o]", pFilePath.get(), mode);
+ TryReturn(err == 0, false, "[osp-installer] chmod() is failed(%s), filepath = [%s], mode = [%o]", strerror(errno), pFilePath.get(), mode);
return true;
}
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
err = chown(pFilePath.get(), APP_OWNER_ID, APP_GROUP_ID);
- TryReturn(err == 0, false, "[osp-installer] chown() is failed, filepath = [%s]", pFilePath.get());
+ TryReturn(err == 0, false, "[osp-installer] chown() is failed(%s), filepath = [%s]", strerror(errno), pFilePath.get());
return true;
}
if (InstallerUtil::IsSymlink(PATH_OPT_APPS) == true &&
inPath.StartsWith(PATH_OPT_USR_APPS, 0) == true)
{
+ AppLogTag(OSP_INSTALLER, "CreateSymlinkForAppId() return false, path = [%ls]", inPath.GetPointer());
outPath = inPath;
return false;
}