ifcfg-rh: fix build

Rebasing the shvar changes to master added some new instances of
svNewFile() and svWriteFile() (in the aliases code) that needed to be
updated for the API changes.
This commit is contained in:
Dan Winship 2014-04-09 12:43:35 -04:00
parent 3cd17c8dc9
commit 88fcf17ce0
3 changed files with 7 additions and 5 deletions

View file

@ -1562,10 +1562,12 @@ read_aliases (NMSettingIP4Config *s_ip4, const char *filename, const char *netwo
continue;
}
parsed = svNewFile (full_path);
parsed = svOpenFile (full_path, &err);
if (!parsed) {
PLUGIN_WARN (IFCFG_PLUGIN_NAME, " alias: couldn't parse file '%s'", full_path);
PLUGIN_WARN (IFCFG_PLUGIN_NAME, " alias: couldn't parse file '%s': %s",
full_path, err->message);
g_free (full_path);
g_clear_error (&err);
continue;
}

View file

@ -8149,7 +8149,7 @@ test_write_wired_aliases (void)
ifcfg = svCreateFile (TEST_SCRATCH_ALIAS_BASE ":2");
svSetValue (ifcfg, "DEVICE", "alias0:2", FALSE);
svSetValue (ifcfg, "IPADDR", "192.168.1.2", FALSE);
svWriteFile (ifcfg, 0644);
svWriteFile (ifcfg, 0644, NULL);
svCloseFile (ifcfg);
ASSERT (g_file_test (TEST_SCRATCH_ALIAS_BASE ":2", G_FILE_TEST_EXISTS),
"wired-aliases-write", "failed to write extra alias file");
@ -8157,7 +8157,7 @@ test_write_wired_aliases (void)
ifcfg = svCreateFile (TEST_SCRATCH_ALIAS_BASE ":5");
svSetValue (ifcfg, "DEVICE", "alias0:5", FALSE);
svSetValue (ifcfg, "IPADDR", "192.168.1.5", FALSE);
svWriteFile (ifcfg, 0644);
svWriteFile (ifcfg, 0644, NULL);
svCloseFile (ifcfg);
ASSERT (g_file_test (TEST_SCRATCH_ALIAS_BASE ":5", G_FILE_TEST_EXISTS),
"wired-aliases-write", "failed to write extra alias file");

View file

@ -2227,7 +2227,7 @@ write_ip4_aliases (NMConnection *connection, char *base_ifcfg_path)
svSetValue (ifcfg, "GATEWAY", &buf[0], FALSE);
}
svWriteFile (ifcfg, 0644);
svWriteFile (ifcfg, 0644, NULL);
svCloseFile (ifcfg);
}