diff options
author | Grant Erickson <erick205@umn.edu> | 2023-12-04 22:31:51 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2023-12-08 01:55:44 +0100 |
commit | 245c985c08fc7cb01221349575cef50bbc97df02 (patch) | |
tree | 7bfa65560653b5528f686fea3c50b3f69a436816 | |
parent | 1b9b68f75640e0a2d9db0673e262e6a8665113c3 (diff) | |
download | connman-245c985c08fc7cb01221349575cef50bbc97df02.tar.gz |
connection: Change return type of 'set_default_gateway'.
This changes the return signature of 'set_default_gateway' from
'void' to 'int' such that its status can be leveraged for conditional
execution where it is called.
-rw-r--r-- | src/connection.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/connection.c b/src/connection.c index 702e08dbe..2a21e476b 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1371,12 +1371,15 @@ done: * which the call to this function should * be attributed. * + * @returns + * 0 if successful; otherwise, < 0 on error. + * * @sa mutate_default_gateway * @sa set_ipv4_high_priority_default_gateway * @sa set_ipv6_high_priority_default_gateway * */ -static void set_default_gateway(struct gateway_data *data, +static int set_default_gateway(struct gateway_data *data, enum connman_ipconfig_type type, const char *function) { @@ -1390,9 +1393,12 @@ static void set_default_gateway(struct gateway_data *data, status = mutate_default_gateway(data, type, &ops, __func__); if (status < 0) - return; + goto done; __connman_service_indicate_default(data->service); + +done: + return status; } static int unset_ipv4_high_priority_default_gateway( |