[haiku-commits] haiku: hrev47838 - src/kits/tracker

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 8 Sep 2014 03:40:48 +0200 (CEST)

hrev47838 adds 1 changeset to branch 'master'
old head: 1819aa71eeea86d951569eaa05bbe9eedfbf222e
new head: 360431e694d6cb3024cd7d331c79b8172cc31da1
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=360431e+%5E1819aa7

----------------------------------------------------------------------------

360431e: 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.

                                         [ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev47838
Commit:      360431e694d6cb3024cd7d331c79b8172cc31da1
URL:         http://cgit.haiku-os.org/haiku/commit/?id=360431e
Author:      Rene Gollent <rene@xxxxxxxxxxx>
Date:        Mon Sep  8 01:37:39 2014 UTC

Ticket:      https://dev.haiku-os.org/ticket/11193

----------------------------------------------------------------------------

1 file changed, 3 insertions(+), 1 deletion(-)
src/kits/tracker/FSUtils.cpp | 4 +++-

----------------------------------------------------------------------------

diff --git a/src/kits/tracker/FSUtils.cpp b/src/kits/tracker/FSUtils.cpp
index 6414abc..01af1d8 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;


Other related posts:

  • » [haiku-commits] haiku: hrev47838 - src/kits/tracker - anevilyak