mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 05:58:01 +02:00
core: add nm_active_connection_set_state_fail() helper
(cherry picked from commit c027fc5d82)
This commit is contained in:
parent
e127a54ba6
commit
4b35d0c109
2 changed files with 34 additions and 0 deletions
|
|
@ -292,6 +292,36 @@ nm_active_connection_set_state (NMActiveConnection *self,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
nm_active_connection_set_state_fail (NMActiveConnection *self,
|
||||||
|
NMActiveConnectionStateReason reason,
|
||||||
|
const char *error_desc)
|
||||||
|
{
|
||||||
|
NMActiveConnectionState s;
|
||||||
|
|
||||||
|
g_return_if_fail (NM_IS_ACTIVE_CONNECTION (self));
|
||||||
|
|
||||||
|
if (error_desc) {
|
||||||
|
_LOGD ("Failed to activate '%s': %s",
|
||||||
|
nm_active_connection_get_settings_connection_id (self),
|
||||||
|
error_desc);
|
||||||
|
}
|
||||||
|
|
||||||
|
s = nm_active_connection_get_state (self);
|
||||||
|
if ( s >= NM_ACTIVE_CONNECTION_STATE_ACTIVATING
|
||||||
|
&& s < NM_ACTIVE_CONNECTION_STATE_DEACTIVATING) {
|
||||||
|
nm_active_connection_set_state (self,
|
||||||
|
NM_ACTIVE_CONNECTION_STATE_DEACTIVATING,
|
||||||
|
reason);
|
||||||
|
s = nm_active_connection_get_state (self);
|
||||||
|
}
|
||||||
|
if (s < NM_ACTIVE_CONNECTION_STATE_DEACTIVATED) {
|
||||||
|
nm_active_connection_set_state (self,
|
||||||
|
NM_ACTIVE_CONNECTION_STATE_DEACTIVATED,
|
||||||
|
reason);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NMActivationStateFlags
|
NMActivationStateFlags
|
||||||
nm_active_connection_get_state_flags (NMActiveConnection *self)
|
nm_active_connection_get_state_flags (NMActiveConnection *self)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -148,6 +148,10 @@ void nm_active_connection_set_state (NMActiveConnection *self,
|
||||||
NMActiveConnectionState state,
|
NMActiveConnectionState state,
|
||||||
NMActiveConnectionStateReason reason);
|
NMActiveConnectionStateReason reason);
|
||||||
|
|
||||||
|
void nm_active_connection_set_state_fail (NMActiveConnection *active,
|
||||||
|
NMActiveConnectionStateReason reason,
|
||||||
|
const char *error_desc);
|
||||||
|
|
||||||
NMActivationStateFlags nm_active_connection_get_state_flags (NMActiveConnection *self);
|
NMActivationStateFlags nm_active_connection_get_state_flags (NMActiveConnection *self);
|
||||||
|
|
||||||
void nm_active_connection_set_state_flags_full (NMActiveConnection *self,
|
void nm_active_connection_set_state_flags_full (NMActiveConnection *self,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue