From 6f73151786dbd1bc4d2d3a892c13252b416071e0 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 9 Aug 2019 16:22:22 +0200 Subject: [PATCH] [libcalamares] Reduce warnings - Although milliseconds::count() is long long, we pass it to a Qt interface that only takes int; let's assume we have only a 32-bit count, since a timeout of 4 billion milliseconds is roughly 46 days, which we'll just call "no timeout". --- src/libcalamares/utils/CalamaresUtilsSystem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.cpp b/src/libcalamares/utils/CalamaresUtilsSystem.cpp index 00b879224..ea8f507bd 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.cpp +++ b/src/libcalamares/utils/CalamaresUtilsSystem.cpp @@ -236,8 +236,9 @@ System::runCommand( System::RunLocation location, } process.closeWriteChannel(); - if ( !process.waitForFinished( - timeoutSec > std::chrono::seconds::zero() ? ( std::chrono::milliseconds( timeoutSec ).count() ) : -1 ) ) + if ( !process.waitForFinished( timeoutSec > std::chrono::seconds::zero() + ? ( static_cast< int >( std::chrono::milliseconds( timeoutSec ).count() ) ) + : -1 ) ) { cWarning().noquote().nospace() << "Timed out. Output so far:\n" << process.readAllStandardOutput(); return ProcessResult::Code::TimedOut;