diff options
author | Thomas Haller <thaller@redhat.com> | 2018-04-04 18:23:38 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-04-05 11:30:14 +0200 |
commit | 95d24929aa6d6cae5cb5ea20b4920735aef8ade1 (patch) | |
tree | 38a3ffe7ccf0db40352b69c7b0d4d22a0c336f60 | |
parent | c4048d4d90fda904e4ae8e68e35cb547c53cfce3 (diff) | |
download | NetworkManager-95d24929aa6d6cae5cb5ea20b4920735aef8ade1.tar.gz |
ifcfg-rh: minor cleanup setting out_ignore_error in connection_from_file_full()
- ensure that out_ignore_error is always initialized. Though,
in practice all callers already made sure of that.
- use NM_SET_OUT() macro.
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index 5af5f200f6..1769541a26 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -5322,6 +5322,8 @@ connection_from_file_full (const char *filename, g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (out_unhandled && !*out_unhandled, NULL); + NM_SET_OUT (out_ignore_error, FALSE); + /* Non-NULL only for unit tests; normally use /etc/sysconfig/network */ if (!network_file) network_file = SYSCONFDIR "/sysconfig/network"; @@ -5351,8 +5353,7 @@ connection_from_file_full (const char *filename, /* iBFT is handled by the iBFT settings plugin */ bootproto = svGetValueStr_cp (parsed, "BOOTPROTO"); if (bootproto && !g_ascii_strcasecmp (bootproto, "ibft")) { - if (out_ignore_error) - *out_ignore_error = TRUE; + NM_SET_OUT (out_ignore_error, TRUE); g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Ignoring iBFT configuration"); g_free (bootproto); @@ -5398,8 +5399,7 @@ connection_from_file_full (const char *filename, char *device; if ((tmp = svGetValueStr_cp (parsed, "IPV6TUNNELIPV4"))) { - if (out_ignore_error) - *out_ignore_error = TRUE; + NM_SET_OUT (out_ignore_error, TRUE); g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Ignoring unsupported connection due to IPV6TUNNELIPV4"); return NULL; @@ -5413,8 +5413,7 @@ connection_from_file_full (const char *filename, } if (!strcmp (device, "lo")) { - if (out_ignore_error) - *out_ignore_error = TRUE; + NM_SET_OUT (out_ignore_error, TRUE); g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Ignoring loopback device config."); g_free (device); @@ -5461,8 +5460,7 @@ connection_from_file_full (const char *filename, memcpy (p_path, IFUP_PATH_PREFIX, NM_STRLEN (IFUP_PATH_PREFIX)); if (access (p_path, X_OK) == 0) { /* for all other types, this is not something we want to handle. */ - if (out_ignore_error) - *out_ignore_error = TRUE; + NM_SET_OUT (out_ignore_error, TRUE); g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, "Ignore script for unknown device type which has a matching %s script", p_path); |