From 87b3de0e39504fcce87ad01acebd6c2e5db7be3d Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 30 Aug 2021 11:37:58 +0200 Subject: [PATCH] Utils: Add a code path taking care of cross-device file copies Not optimal, but will suffice for docker callgrind. Change-Id: Iac669fe9dd29206df2a4ffc61d659afce2f7a6c4 Reviewed-by: Christian Stenger --- src/libs/utils/filepath.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/utils/filepath.cpp b/src/libs/utils/filepath.cpp index 6dee6cd67c0..df07f602440 100644 --- a/src/libs/utils/filepath.cpp +++ b/src/libs/utils/filepath.cpp @@ -1307,6 +1307,11 @@ bool FilePath::removeRecursively(QString *error) const bool FilePath::copyFile(const FilePath &target) const { + if (host() != target.host()) { + // FIXME: This does not scale. + const QByteArray ba = fileContents(); + return target.writeFileContents(ba); + } if (needsDevice()) { QTC_ASSERT(s_deviceHooks.copyFile, return false); return s_deviceHooks.copyFile(*this, target);