mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-02 23:48:20 +02:00
keyfile: don't check for info->error before calling handle_warn()
When an error gets set, we should abort right away. We should not come into a situation where we would try to emit another warning. Don't check for a condition that should never happen and assert against it.
This commit is contained in:
parent
8afb8ba819
commit
021726e54e
1 changed files with 10 additions and 10 deletions
|
|
@ -91,6 +91,8 @@ _handle_warn (KeyfileReaderInfo *info,
|
|||
({ \
|
||||
KeyfileReaderInfo *_info = (arg_info); \
|
||||
\
|
||||
nm_assert (!_info->error); \
|
||||
\
|
||||
if (_info->read_handler) { \
|
||||
_handle_warn (_info, (arg_property_name), (arg_severity), \
|
||||
g_strdup_printf (__VA_ARGS__)); \
|
||||
|
|
@ -281,14 +283,12 @@ build_route (KeyfileReaderInfo *info,
|
|||
metric = u32;
|
||||
gateway_str = NULL;
|
||||
} else {
|
||||
if (!info->error) {
|
||||
handle_warn (info,
|
||||
property_name,
|
||||
NM_KEYFILE_WARN_SEVERITY_WARN,
|
||||
_("ignoring invalid gateway '%s' for %s route"),
|
||||
gateway_str,
|
||||
family == AF_INET ? "IPv4" : "IPv6");
|
||||
}
|
||||
handle_warn (info,
|
||||
property_name,
|
||||
NM_KEYFILE_WARN_SEVERITY_WARN,
|
||||
_("ignoring invalid gateway '%s' for %s route"),
|
||||
gateway_str,
|
||||
family == AF_INET ? "IPv4" : "IPv6");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
@ -1292,7 +1292,7 @@ ssid_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *key)
|
|||
if (bytes) {
|
||||
g_object_set (setting, key, bytes, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
} else if (!info->error) {
|
||||
} else {
|
||||
handle_warn (info,
|
||||
key,
|
||||
NM_KEYFILE_WARN_SEVERITY_WARN,
|
||||
|
|
@ -1310,7 +1310,7 @@ password_raw_parser (KeyfileReaderInfo *info, NMSetting *setting, const char *ke
|
|||
if (bytes) {
|
||||
g_object_set (setting, key, bytes, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
} else if (!info->error) {
|
||||
} else {
|
||||
handle_warn (info,
|
||||
key,
|
||||
NM_KEYFILE_WARN_SEVERITY_WARN,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue