From 360431e694d6cb3024cd7d331c79b8172cc31da1 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 7 Sep 2014 21:37:39 -0400 Subject: [PATCH] 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. --- src/kits/tracker/FSUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp index 6414abc97c..01af1d871e 100644 --- a/src/kits/tracker/FSUtils.cpp +++ b/src/kits/tracker/FSUtils.cpp @@ -1243,7 +1243,9 @@ LowLevelCopy(BEntry* srcEntry, StatStruct* srcStat, BDirectory* destDir, char linkpath[MAXPATHLEN]; 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)); node_ref destNodeRef;