mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-07-21 18:24:49 +00:00
libnm: fix return value for nm_remote_settings_reload_connections*() to ignore server result
Note that the server always returns TRUE for the boolean return value of ReloadConnections. Hence, this should not change in behavior, because the server would never have returned FALSE. However, change behavior of the API. It's odd that the function might return %FALSE without setting the error output. It's also not clear what the boolean value of the "ReloadConnections" D-Bus would mean anyway.
This commit is contained in:
parent
9dac3076f7
commit
86097cc2e8
|
@ -120,7 +120,7 @@
|
|||
|
||||
<!--
|
||||
ReloadConnections:
|
||||
@status: Success or failure.
|
||||
@status: This always returns %TRUE.
|
||||
|
||||
Tells NetworkManager to reload all connection files from disk, including
|
||||
noticing any added or deleted connection files. By default, connections
|
||||
|
|
|
@ -503,10 +503,10 @@ nm_remote_settings_reload_connections (NMRemoteSettings *settings,
|
|||
cancellable, error)) {
|
||||
if (error && *error)
|
||||
g_dbus_error_strip_remote_error (*error);
|
||||
success = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return success;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -519,7 +519,7 @@ reload_connections_cb (GObject *proxy, GAsyncResult *result, gpointer user_data)
|
|||
if (nmdbus_settings_call_reload_connections_finish (NMDBUS_SETTINGS (proxy),
|
||||
&success,
|
||||
result, &error))
|
||||
g_simple_async_result_set_op_res_gboolean (simple, success);
|
||||
g_simple_async_result_set_op_res_gboolean (simple, TRUE);
|
||||
else {
|
||||
g_dbus_error_strip_remote_error (error);
|
||||
g_simple_async_result_take_error (simple, error);
|
||||
|
|
|
@ -2821,6 +2821,7 @@ impl_settings_reload_connections (NMDBusObject *obj,
|
|||
|
||||
nm_audit_log_connection_op (NM_AUDIT_OP_CONNS_RELOAD, NULL, TRUE, NULL, invocation, NULL);
|
||||
|
||||
/* We MUST return %TRUE here, otherwise older libnm versions might misbehave. */
|
||||
g_dbus_method_invocation_return_value (invocation, g_variant_new ("(b)", TRUE));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue