From 88fcf17ce05ba67073ebdd3d3816f3ee3da9e6b3 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 9 Apr 2014 12:43:35 -0400 Subject: [PATCH] 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. --- src/settings/plugins/ifcfg-rh/reader.c | 6 ++++-- src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 4 ++-- src/settings/plugins/ifcfg-rh/writer.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/reader.c b/src/settings/plugins/ifcfg-rh/reader.c index 3b0379c200..8b82ff9ac4 100644 --- a/src/settings/plugins/ifcfg-rh/reader.c +++ b/src/settings/plugins/ifcfg-rh/reader.c @@ -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; } diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index 082d6fd585..b2a9bc3dfd 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -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"); diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c index 1f0e6a9dda..c9758beeb5 100644 --- a/src/settings/plugins/ifcfg-rh/writer.c +++ b/src/settings/plugins/ifcfg-rh/writer.c @@ -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); }