profiles/network: Log connection event after setting device name
authoredef <edef@edef.eu>
Thu, 27 Aug 2020 11:27:59 +0000 (11:27 +0000)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:50 +0000 (14:30 +0530)
Without reordering these two statements, the logs look like this:

    bnep%d connected
    bnep0 disconnected

Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
profiles/network/connection.c

index b2aeeb4..489f29b 100644 (file)
@@ -234,9 +234,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)