[PATCH 22/22] service: Capture and propagate '__connman_wispr_start' return status.

Grant Erickson <[email protected]>
Newsgroups dev.linux.lists.connman
Message-ID <c9ba9fe4ee145481b360a3ab8c35992552766063.1741050622.git.gerickson@nuovations.com>
'__connman_wispr_start' has a number of early failure conditions
before the call closure becomes asynchronous. Capture the return
status from '__connman_wispr_start' in '__connman_service_wispr_start'
and propagate it forward, ensuring that 'online_check_active_set' is
NOT called in the failure case.
---
 src/service.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/service.c b/src/service.c
index 0cfb516016b5..48a7d1f72367 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4003,6 +4003,8 @@ static int start_online_check_if_connected(struct connman_service *service)
 int __connman_service_wispr_start(struct connman_service *service,
 					enum connman_ipconfig_type type)
 {
+	int err;
+
 	DBG("service %p (%s) type %d (%s)",
 		service,
 		connman_service_get_identifier(service),
@@ -4034,14 +4036,17 @@ int __connman_service_wispr_start(struct connman_service *service,
 		service->online_check_state_ipv6.interval =
 					online_check_initial_interval;
 
-	__connman_wispr_start(service, type,
+	err = __connman_wispr_start(service, type,
 			online_check_connect_timeout_ms, complete_online_check);
+	if (err < 0)
+		goto done;
 
 	/* Mark the online check state as active. */
 
 	online_check_active_set(service, type);
 
-	return 0;
+done:
+	return err;
 }
 
 /**
-- 
2.45.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.