core: Use timeout_add_seconds 41/285041/1 accepted/tizen/unified/20221206.170555
authorWootak Jung <wootak.jung@samsung.com>
Mon, 5 Dec 2022 04:20:29 +0000 (13:20 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 5 Dec 2022 04:38:24 +0000 (13:38 +0900)
Replace calls to g_timeout_add_seconds() by the timeout_add_seconds()
wrapper which takes care of 0 delay.

Change-Id: I9b8cc6d6d3f625eb3a51720446b4aaf720ca65ec
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
src/adapter.c

index d1f7751..e9b11b6 100644 (file)
@@ -2392,7 +2392,7 @@ static void start_le_discovery_complete(uint8_t status, uint16_t length,
 #endif
 
 #ifdef TIZEN_FEATURE_BLUEZ_MODIFY
-static gboolean start_le_discovery_timeout(gpointer user_data)
+static bool start_le_discovery_timeout(gpointer user_data)
 {
        struct btd_adapter *adapter = user_data;
        uint8_t new_type;
@@ -2575,8 +2575,8 @@ static void trigger_start_le_discovery(struct btd_adapter *adapter, guint delay)
        if (!(adapter->current_settings & MGMT_SETTING_POWERED))
                return;
 
-       adapter->le_discovery_idle_timeout = g_timeout_add_seconds(delay,
-                                       start_le_discovery_timeout, adapter);
+       adapter->le_discovery_idle_timeout = timeout_add_seconds(delay,
+                                       start_le_discovery_timeout, adapter, NULL);
 }
 #endif