summaryrefslogtreecommitdiff
path: root/zen/symlink_target.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-04-18 17:00:42 +0000
committerB Stack <bgstack15@gmail.com>2020-04-18 17:00:42 +0000
commitb4ecf755bad016b0d7fbb277106887f405f6b600 (patch)
tree8cfcea5441be72ad92095a3887ded84d38f9ba11 /zen/symlink_target.h
parentMerge branch '10.22' into 'master' (diff)
parentadd upstream 10.23 (diff)
downloadFreeFileSync-b4ecf755bad016b0d7fbb277106887f405f6b600.tar.gz
FreeFileSync-b4ecf755bad016b0d7fbb277106887f405f6b600.tar.bz2
FreeFileSync-b4ecf755bad016b0d7fbb277106887f405f6b600.zip
Merge branch '10.23' into 'master'10.23
add upstream 10.23 See merge request opensource-tracking/FreeFileSync!20
Diffstat (limited to 'zen/symlink_target.h')
-rw-r--r--zen/symlink_target.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/zen/symlink_target.h b/zen/symlink_target.h
index 2393013e..077fd4b3 100644
--- a/zen/symlink_target.h
+++ b/zen/symlink_target.h
@@ -42,9 +42,9 @@ Zstring getSymlinkRawTargetString_impl(const Zstring& linkPath) //throw FileErro
const ssize_t bytesWritten = ::readlink(linkPath.c_str(), &buffer[0], BUFFER_SIZE);
if (bytesWritten < 0)
- THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"readlink");
+ THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), "readlink");
if (bytesWritten >= static_cast<ssize_t>(BUFFER_SIZE)) //detect truncation, not an error for readlink!
- throw FileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"readlink: buffer truncated.");
+ throw FileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), formatSystemError("readlink", L"", L"Buffer truncated."));
return Zstring(&buffer[0], bytesWritten); //readlink does not append 0-termination!
}
@@ -55,7 +55,7 @@ Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw FileError
using namespace zen;
char* targetPath = ::realpath(linkPath.c_str(), nullptr);
if (!targetPath)
- THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), L"realpath");
+ THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), "realpath");
ZEN_ON_SCOPE_EXIT(::free(targetPath));
return targetPath;
}
bgstack15