mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 18:40:22 +01:00
ifcfg-rh: fix handling error writing route file to disk
Do not return failure based on whether an @error argument is given.
This commit is contained in:
parent
19ebfdba5e
commit
56d77ba568
1 changed files with 6 additions and 10 deletions
|
|
@ -2294,11 +2294,9 @@ write_ip4_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||
(void) unlink (route_path);
|
||||
else {
|
||||
if (!g_file_set_contents (route_path, routes_file->str, routes_file->len, NULL)) {
|
||||
if (error) {
|
||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
|
||||
"Writing route file '%s' failed", route_path);
|
||||
return FALSE;
|
||||
}
|
||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
|
||||
"Writing route file '%s' failed", route_path);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2669,11 +2667,9 @@ write_ip6_setting (NMConnection *connection, shvarFile *ifcfg, GError **error)
|
|||
(void) unlink (route6_path);
|
||||
else {
|
||||
if (!g_file_set_contents (route6_path, routes_file->str, routes_file->len, NULL)) {
|
||||
if (error) {
|
||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
|
||||
"Writing route6 file '%s' failed", route6_path);
|
||||
return FALSE;
|
||||
}
|
||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_FAILED,
|
||||
"Writing route6 file '%s' failed", route6_path);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue