diff --git a/system-settings/plugins/keyfile/nm-keyfile-connection.c b/system-settings/plugins/keyfile/nm-keyfile-connection.c index 2e9aa0fb5b..9dd2c750db 100644 --- a/system-settings/plugins/keyfile/nm-keyfile-connection.c +++ b/system-settings/plugins/keyfile/nm-keyfile-connection.c @@ -85,7 +85,7 @@ nm_keyfile_connection_new (const char *full_path, g_object_set (s_con, NM_SETTING_CONNECTION_UUID, uuid, NULL); g_free (uuid); - if (!write_connection (NM_CONNECTION (object), KEYFILE_DIR, 0, 0, NULL, &write_error)) { + if (!nm_keyfile_plugin_write_connection (NM_CONNECTION (object), KEYFILE_DIR, 0, 0, NULL, &write_error)) { PLUGIN_WARN (KEYFILE_PLUGIN_NAME, "Couldn't update connection %s with a UUID: (%d) %s", nm_setting_connection_get_id (s_con), @@ -117,7 +117,7 @@ commit_changes (NMSettingsConnection *connection, char *path = NULL; GError *error = NULL; - if (!write_connection (NM_CONNECTION (connection), KEYFILE_DIR, 0, 0, &path, &error)) { + if (!nm_keyfile_plugin_write_connection (NM_CONNECTION (connection), KEYFILE_DIR, 0, 0, &path, &error)) { callback (connection, error, user_data); g_clear_error (&error); return; diff --git a/system-settings/plugins/keyfile/plugin.c b/system-settings/plugins/keyfile/plugin.c index 819b809714..ec37ed3116 100644 --- a/system-settings/plugins/keyfile/plugin.c +++ b/system-settings/plugins/keyfile/plugin.c @@ -127,7 +127,7 @@ read_connections (NMSystemConfigInterface *config) NMSettingsConnection *connection; char *full_path; - if (utils_should_ignore_file (item)) + if (nm_keyfile_plugin_utils_should_ignore_file (item)) continue; full_path = g_build_filename (KEYFILE_DIR, item, NULL); @@ -224,7 +224,7 @@ dir_changed (GFileMonitor *monitor, GError *error = NULL; full_path = g_file_get_path (file); - if (utils_should_ignore_file (full_path)) { + if (nm_keyfile_plugin_utils_should_ignore_file (full_path)) { g_free (full_path); return; } @@ -416,7 +416,7 @@ add_connection (NMSystemConfigInterface *config, char *path = NULL; /* Write it out first, then add the connection to our internal list */ - if (write_connection (connection, KEYFILE_DIR, 0, 0, &path, error)) { + if (nm_keyfile_plugin_write_connection (connection, KEYFILE_DIR, 0, 0, &path, error)) { added = _internal_new_connection (self, path, connection, NULL, error); g_free (path); } diff --git a/system-settings/plugins/keyfile/tests/test-keyfile.c b/system-settings/plugins/keyfile/tests/test-keyfile.c index 213d3e87fe..e79c8a3307 100644 --- a/system-settings/plugins/keyfile/tests/test-keyfile.c +++ b/system-settings/plugins/keyfile/tests/test-keyfile.c @@ -693,7 +693,7 @@ test_write_wired_connection (void) /* Write out the connection */ owner_uid = geteuid (); owner_grp = getegid (); - success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + success = nm_keyfile_plugin_write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); ASSERT (success == TRUE, "connection-write", "failed to allocate write keyfile: %s", error ? error->message : "(none)"); @@ -953,7 +953,7 @@ test_write_ip6_wired_connection (void) /* Write out the connection */ owner_uid = geteuid (); owner_grp = getegid (); - success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + success = nm_keyfile_plugin_write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); ASSERT (success == TRUE, "connection-write", "failed to allocate write keyfile: %s", error ? error->message : "(none)"); @@ -1271,7 +1271,7 @@ test_write_wireless_connection (void) /* Write out the connection */ owner_uid = geteuid (); owner_grp = getegid (); - success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + success = nm_keyfile_plugin_write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); ASSERT (success == TRUE, "connection-write", "failed to allocate write keyfile: %s", error ? error->message : "(none)"); @@ -1401,7 +1401,7 @@ test_write_string_ssid (void) /* Write out the connection */ owner_uid = geteuid (); owner_grp = getegid (); - success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + success = nm_keyfile_plugin_write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); ASSERT (success == TRUE, "connection-write", "failed to allocate write keyfile: %s", error ? error->message : "(none)"); @@ -1699,7 +1699,7 @@ test_write_bt_dun_connection (void) /* Write out the connection */ owner_uid = geteuid (); owner_grp = getegid (); - success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + success = nm_keyfile_plugin_write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); ASSERT (success == TRUE, "connection-write", "failed to allocate write keyfile: %s", error ? error->message : "(none)"); @@ -1961,7 +1961,7 @@ test_write_gsm_connection (void) /* Write out the connection */ owner_uid = geteuid (); owner_grp = getegid (); - success = write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); + success = nm_keyfile_plugin_write_connection (connection, TEST_SCRATCH_DIR, owner_uid, owner_grp, &testfile, &error); ASSERT (success == TRUE, "connection-write", "failed to allocate write keyfile: %s", error ? error->message : "(none)"); diff --git a/system-settings/plugins/keyfile/utils.c b/system-settings/plugins/keyfile/utils.c index de64f7913b..c7cdc63108 100644 --- a/system-settings/plugins/keyfile/utils.c +++ b/system-settings/plugins/keyfile/utils.c @@ -75,7 +75,7 @@ check_suffix (const char *base, const char *tag) } gboolean -utils_should_ignore_file (const char *filename) +nm_keyfile_plugin_utils_should_ignore_file (const char *filename) { char *base; gboolean ignore = FALSE; diff --git a/system-settings/plugins/keyfile/utils.h b/system-settings/plugins/keyfile/utils.h index 3c1a6104bd..68e6e56f21 100644 --- a/system-settings/plugins/keyfile/utils.h +++ b/system-settings/plugins/keyfile/utils.h @@ -24,7 +24,7 @@ #include #include "common.h" -gboolean utils_should_ignore_file (const char *filename); +gboolean nm_keyfile_plugin_utils_should_ignore_file (const char *filename); #endif /* _UTILS_H_ */ diff --git a/system-settings/plugins/keyfile/writer.c b/system-settings/plugins/keyfile/writer.c index 550405f95e..0574f90a38 100644 --- a/system-settings/plugins/keyfile/writer.c +++ b/system-settings/plugins/keyfile/writer.c @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 - 2010 Red Hat, Inc. + * Copyright (C) 2008 - 2011 Red Hat, Inc. */ #include @@ -667,8 +667,8 @@ write_setting_value (NMSetting *setting, } } -char * -writer_id_to_filename (const char *id) +static char * +_writer_id_to_filename (const char *id) { char *filename, *f; const char *i = id; @@ -688,12 +688,12 @@ writer_id_to_filename (const char *id) } gboolean -write_connection (NMConnection *connection, - const char *keyfile_dir, - uid_t owner_uid, - pid_t owner_grp, - char **out_path, - GError **error) +nm_keyfile_plugin_write_connection (NMConnection *connection, + const char *keyfile_dir, + uid_t owner_uid, + pid_t owner_grp, + char **out_path, + GError **error) { NMSettingConnection *s_con; GKeyFile *key_file; @@ -716,7 +716,7 @@ write_connection (NMConnection *connection, if (!data) goto out; - filename = writer_id_to_filename (nm_setting_connection_get_id (s_con)); + filename = _writer_id_to_filename (nm_setting_connection_get_id (s_con)); path = g_build_filename (keyfile_dir, filename, NULL); g_free (filename); diff --git a/system-settings/plugins/keyfile/writer.h b/system-settings/plugins/keyfile/writer.h index fa04deef98..730a9b3bda 100644 --- a/system-settings/plugins/keyfile/writer.h +++ b/system-settings/plugins/keyfile/writer.h @@ -16,7 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Copyright (C) 2008 Novell, Inc. - * Copyright (C) 2008 Red Hat, Inc. + * Copyright (C) 2008 - 2011 Red Hat, Inc. */ #ifndef _KEYFILE_PLUGIN_WRITER_H @@ -26,13 +26,11 @@ #include #include -gboolean write_connection (NMConnection *connection, - const char *keyfile_dir, - uid_t owner_uid, - pid_t owner_grp, - char **out_path, - GError **error); - -char *writer_id_to_filename (const char *id); +gboolean nm_keyfile_plugin_write_connection (NMConnection *connection, + const char *keyfile_dir, + uid_t owner_uid, + pid_t owner_grp, + char **out_path, + GError **error); #endif /* _KEYFILE_PLUGIN_WRITER_H */