Skip to contentSkip to conversation

profiles/network: Log connection event after setting device name

PATCH Applied edef 2 participants 2 messages Aug 27, 2020 Bluetooth drivers

lore
Share & tools
lore

edef

author
#0 lore raw

PATCH 1/1 profiles/network: Log connection event after setting device name

Without reordering these two statements, the logs look like this:

bnep%d connected
bnep0 disconnected

---
 profiles/network/connection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
profiles/network/connection.c +1 -1
index 97b87d02e..170841de6 100644
@@ -216,9 +216,9 @@ static void bnep_conn_cb(char *iface, int err, void *data)
 		goto failed;
 	}
 
+	memcpy(nc->dev, iface, sizeof(nc->dev));
 	info("%s connected", nc->dev);
 
-	memcpy(nc->dev, iface, sizeof(nc->dev));
 	btd_service_connecting_complete(nc->service, 0);
 
 	if (nc->connect)
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw

Hi Edef,

Quoted 25 lines · edef

Without reordering these two statements, the logs look like this:

bnep%d connected
bnep0 disconnected

---
 profiles/network/connection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
profiles/network/connection.c +1 -2
index 97b87d02e..170841de6 100644
@@ -216,9 +216,9 @@ static void bnep_conn_cb(char *iface, int err, void *data)
                goto failed;
        }
 
+       memcpy(nc->dev, iface, sizeof(nc->dev));
        info("%s connected", nc->dev);
 
-       memcpy(nc->dev, iface, sizeof(nc->dev));
        btd_service_connecting_complete(nc->service, 0);
 
        if (nc->connect)
--
Quoted 1 line

2.27.0

Applied, thanks.

Signature · 1 line
Luiz Augusto von Dentz