diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-24 17:32:01 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-02-24 17:32:42 +0100 |
commit | e4f0b0568c334695cbc3c90f5a040edc61a8dcef (patch) | |
tree | ab2a79d8dddb4ed78de9933d218c5581e04c8b3f /src/bluetooth/qbluetoothserver_bluez.cpp | |
parent | 9cf135dd2c2544a8c1f889b5de38136aa3ec1d4d (diff) | |
parent | dbf0bd93096f8ef54ebcf550ff104237742778dd (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: Ie5ce761b77cc5c02647a9f7d52f427401b85d6b0
Diffstat (limited to 'src/bluetooth/qbluetoothserver_bluez.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothserver_bluez.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothserver_bluez.cpp b/src/bluetooth/qbluetoothserver_bluez.cpp index 2c3bcc8f..d5cdb440 100644 --- a/src/bluetooth/qbluetoothserver_bluez.cpp +++ b/src/bluetooth/qbluetoothserver_bluez.cpp @@ -151,9 +151,11 @@ bool QBluetoothServer::listen(const QBluetoothAddress &address, quint16 port) else convertAddress(device.address().toUInt64(), addr.rc_bdaddr.b); - if (::bind(sock, reinterpret_cast<sockaddr *>(&addr), sizeof(sockaddr_rc)) < 0) { - d->m_lastError = InputOutputError; + if (errno == EADDRINUSE) + d->m_lastError = ServiceAlreadyRegisteredError; + else + d->m_lastError = InputOutputError; emit error(d->m_lastError); return false; } |