Avoid unconditional use of `std::errc::stream_timeout`

It looks like `libstdc++` and `libc++` only define this `enum class` member
when the `ETIME` macro is defined. To prevent build errors when this macro
is not defined it makes sense to check for this error only conditionally.
This commit is contained in:
Martchus 2024-04-05 17:58:14 +02:00
parent 93b5d66875
commit fe3d7891e9
1 changed files with 6 additions and 1 deletions

View File

@ -481,7 +481,12 @@ void SyncthingProcess::start(const QStringList &programs, const QStringList &arg
if (started) {
emit finished(0, QProcess::CrashExit);
}
const auto error = ec == std::errc::timed_out || ec == std::errc::stream_timeout ? QProcess::Timedout : QProcess::Crashed;
const auto error = ec == std::errc::timed_out
#ifdef ETIME
|| ec == std::errc::stream_timeout
#endif
? QProcess::Timedout
: QProcess::Crashed;
const auto msg = ec.message();
std::cerr << EscapeCodes::Phrases::Error << "Unable to launch process: " << msg << EscapeCodes::Phrases::End;
QMetaObject::invokeMethod(