Trying to fix build problems with gcc 4.7 on Linux (#132).
This commit is contained in:
+7
-2
@@ -57,6 +57,7 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0;
|
|||||||
#endif
|
#endif
|
||||||
#if defined(Q_OS_UNIX)
|
#if defined(Q_OS_UNIX)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace QtLP_Private {
|
namespace QtLP_Private {
|
||||||
@@ -164,8 +165,12 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout)
|
|||||||
QDataStream ds(&socket);
|
QDataStream ds(&socket);
|
||||||
ds.writeBytes(uMsg.constData(), uMsg.size());
|
ds.writeBytes(uMsg.constData(), uMsg.size());
|
||||||
bool res = socket.waitForBytesWritten(timeout);
|
bool res = socket.waitForBytesWritten(timeout);
|
||||||
res &= socket.waitForReadyRead(timeout); // wait for ack
|
if (res) {
|
||||||
res &= (socket.read(qstrlen(ack)) == ack);
|
res &= socket.waitForReadyRead(timeout); // wait for ack
|
||||||
|
if (res) {
|
||||||
|
res &= (socket.read(qstrlen(ack)) == ack);
|
||||||
|
}
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user