keyfile: namespace potentially conflicting symbols

Just in case.
This commit is contained in:
Dan Williams 2011-02-04 15:59:45 -06:00
parent 0ba142690a
commit 382cdfaf1e
7 changed files with 30 additions and 32 deletions

View file

@ -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;

View file

@ -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);
}

View file

@ -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)");

View file

@ -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;

View file

@ -24,7 +24,7 @@
#include <glib.h>
#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_ */

View file

@ -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 <sys/stat.h>
@ -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);

View file

@ -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 <glib.h>
#include <nm-connection.h>
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 */