Tracker: Fix #11193.
Fix regression introduced in commit 2f60dea5: BSymlink::ReadLink()
returns a byte count in the success case, which ThrowOnError() does
not anticipate. Consequently, attempts to copy symlinks would fail.
This commit is contained in:
@@ -1243,7 +1243,9 @@ LowLevelCopy(BEntry* srcEntry, StatStruct* srcStat, BDirectory* destDir,
|
|||||||
char linkpath[MAXPATHLEN];
|
char linkpath[MAXPATHLEN];
|
||||||
|
|
||||||
ThrowOnError(srcLink.SetTo(srcEntry));
|
ThrowOnError(srcLink.SetTo(srcEntry));
|
||||||
ThrowOnError(srcLink.ReadLink(linkpath, MAXPATHLEN - 1));
|
ssize_t size = srcLink.ReadLink(linkpath, MAXPATHLEN - 1);
|
||||||
|
if (size < 0)
|
||||||
|
ThrowOnError(size);
|
||||||
ThrowOnError(destDir->CreateSymLink(destName, linkpath, &newLink));
|
ThrowOnError(destDir->CreateSymLink(destName, linkpath, &newLink));
|
||||||
|
|
||||||
node_ref destNodeRef;
|
node_ref destNodeRef;
|
||||||
|
|||||||
Reference in New Issue
Block a user