diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index f55816d59a6..03dda7bffd9 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -960,14 +960,20 @@ expected_str UnixDeviceFileAccess::fileContents(const FilePath &file args += QString("count=%1").arg(limit / gcd); args += QString("seek=%1").arg(offset / gcd); } +#ifndef UTILS_STATIC_LIBRARY + const FilePath dd = filePath.withNewPath("dd"); - const RunResult r = runInShell({"dd", args, OsType::OsTypeLinux}); - - if (r.exitCode != 0) + QtcProcess p; + p.setCommand({dd, args, OsType::OsTypeLinux}); + p.runBlocking(); + if (p.exitCode() != 0) { return make_unexpected(Tr::tr("Failed reading file \"%1\": %2") - .arg(filePath.toUserOutput(), QString::fromUtf8(r.stdErr))); - - return r.stdOut; + .arg(filePath.toUserOutput(), p.readAllStandardError())); + } + return p.readAllRawStandardOutput(); +#else + return make_unexpected(QString("Not implemented")); +#endif } expected_str UnixDeviceFileAccess::writeFileContents(const FilePath &filePath,