From a121f61ca1e7703f90d78c606bdc40de9ad344cf Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Mon, 5 Oct 2020 22:13:03 +0200 Subject: [PATCH] Fix return value of connectToPrimary() when connect is successful --- singleapplication_p.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/singleapplication_p.cpp b/singleapplication_p.cpp index 4d74e06..3b41391 100644 --- a/singleapplication_p.cpp +++ b/singleapplication_p.cpp @@ -267,10 +267,9 @@ bool SingleApplicationPrivate::connectToPrimary( int timeout, ConnectionType con 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; } quint16 SingleApplicationPrivate::blockChecksum()