summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothserver_bluez.cpp
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-24 17:32:01 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-24 17:32:42 +0100
commite4f0b0568c334695cbc3c90f5a040edc61a8dcef (patch)
treeab2a79d8dddb4ed78de9933d218c5581e04c8b3f /src/bluetooth/qbluetoothserver_bluez.cpp
parent9cf135dd2c2544a8c1f889b5de38136aa3ec1d4d (diff)
parentdbf0bd93096f8ef54ebcf550ff104237742778dd (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Diffstat (limited to 'src/bluetooth/qbluetoothserver_bluez.cpp')
-rw-r--r--src/bluetooth/qbluetoothserver_bluez.cpp6
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;
}