diff --git a/3rdparty/singleapplication/singleapplication_p.cpp b/3rdparty/singleapplication/singleapplication_p.cpp index f6d3477eb..10965af40 100644 --- a/3rdparty/singleapplication/singleapplication_p.cpp +++ b/3rdparty/singleapplication/singleapplication_p.cpp @@ -277,10 +277,10 @@ bool SingleApplicationPrivate::connectToPrimary(int timeout, ConnectionType conn socket_->write(header); socket_->write(initMsg); + bool result = socket_->waitForBytesWritten(timeout - time.elapsed()); socket_->flush(); - if (socket_->waitForBytesWritten(timeout - time.elapsed())) return true; - return false; + return result; } diff --git a/3rdparty/singleapplication/singlecoreapplication_p.cpp b/3rdparty/singleapplication/singlecoreapplication_p.cpp index 09ed635f6..1ba8ef2bb 100644 --- a/3rdparty/singleapplication/singlecoreapplication_p.cpp +++ b/3rdparty/singleapplication/singlecoreapplication_p.cpp @@ -277,10 +277,10 @@ bool SingleCoreApplicationPrivate::connectToPrimary(int timeout, ConnectionType socket_->write(header); socket_->write(initMsg); + bool result = socket_->waitForBytesWritten(timeout - time.elapsed()); socket_->flush(); - if (socket_->waitForBytesWritten(timeout - time.elapsed())) return true; - return false; + return result; }