summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-03-29 08:30:26 +0200
committerThomas Haller <thaller@redhat.com>2018-03-30 13:18:19 +0200
commitb9aa14bd7566bc46b2b6e4c0fe794db13bd9cfb0 (patch)
tree417d76c7f9f954c8d86605d03b0090e35ae883cc
parent3fdca98ef58a145cc1ecb7a15342933478edc0c3 (diff)
downloadNetworkManager-th/checkpoint.tar.gz
checkpoint: minor cleanup of device_checkpoint_create()th/checkpoint
- indent with spaces for wrapped line - drop g_return_val_if_fail(). It really shouldn't happen, and if it does, we can just continue and will hit g_critical() warnings below, when using the variables. - get the NMActRequest instance first, and from there the applied and settings connection. Not the other way around. nm_device_get_settings_connection() and nm_device_get_applied_connection() are just convenience functions to get the fields from act_request.
-rw-r--r--src/nm-checkpoint.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/nm-checkpoint.c b/src/nm-checkpoint.c
index 5865919411..85d86aca52 100644
--- a/src/nm-checkpoint.c
+++ b/src/nm-checkpoint.c
@@ -25,6 +25,7 @@
#include <string.h>
#include "nm-active-connection.h"
+#include "nm-act-request.h"
#include "nm-auth-subject.h"
#include "nm-core-utils.h"
#include "nm-dbus-interface.h"
@@ -422,25 +423,21 @@ device_checkpoint_create (NMDevice *device)
dev_checkpoint->realized = nm_device_is_real (device);
if (nm_device_get_unmanaged_mask (device, NM_UNMANAGED_USER_EXPLICIT)) {
- dev_checkpoint->unmanaged_explicit =
- !!nm_device_get_unmanaged_flags (device, NM_UNMANAGED_USER_EXPLICIT);
+ dev_checkpoint->unmanaged_explicit = !!nm_device_get_unmanaged_flags (device,
+ NM_UNMANAGED_USER_EXPLICIT);
} else
dev_checkpoint->unmanaged_explicit = NM_UNMAN_FLAG_OP_FORGET;
- applied_connection = nm_device_get_applied_connection (device);
- if (applied_connection) {
- dev_checkpoint->applied_connection =
- nm_simple_connection_new_clone (applied_connection);
+ act_request = nm_device_get_act_request (device);
+ if (act_request) {
+ settings_connection = nm_act_request_get_settings_connection (act_request);
+ applied_connection = nm_act_request_get_applied_connection (act_request);
- settings_connection = nm_device_get_settings_connection (device);
- g_return_val_if_fail (settings_connection, NULL);
+ dev_checkpoint->applied_connection = nm_simple_connection_new_clone (applied_connection);
dev_checkpoint->settings_connection =
- nm_simple_connection_new_clone (NM_CONNECTION (settings_connection));
-
- act_request = nm_device_get_act_request (device);
- g_return_val_if_fail (act_request, NULL);
+ nm_simple_connection_new_clone (NM_CONNECTION (settings_connection));
dev_checkpoint->ac_version_id =
- nm_active_connection_version_id_get (NM_ACTIVE_CONNECTION (act_request));
+ nm_active_connection_version_id_get (NM_ACTIVE_CONNECTION (act_request));
}
return dev_checkpoint;