From: "Alexandre Restovtsev" <tetromino@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc-settingsd:master commit in: src/
Date: Sun, 5 Feb 2012 00:20:40 +0000 (UTC) [thread overview]
Message-ID: <8f23cc229ef22542624b08b8b7f28219d0c3a5f8.tetromino@gentoo> (raw)
commit: 8f23cc229ef22542624b08b8b7f28219d0c3a5f8
Author: Alexandre Rostovtsev <tetromino <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 5 00:01:35 2012 +0000
Commit: Alexandre Restovtsev <tetromino <AT> gmail <DOT> com>
CommitDate: Sun Feb 5 00:20:04 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc-settingsd.git;a=commit;h=8f23cc22
GStaticMutex is deprecated in glib-2.31
---
src/hostnamed.c | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/src/hostnamed.c b/src/hostnamed.c
index b431aac..d910fb0 100644
--- a/src/hostnamed.c
+++ b/src/hostnamed.c
@@ -43,12 +43,12 @@ gboolean read_only = FALSE;
static OpenrcSettingsdHostnamedHostname1 *hostname1 = NULL;
static gchar hostname[HOST_NAME_MAX + 1];
-static GStaticMutex hostname_mutex = G_STATIC_MUTEX_INIT;
+G_LOCK_DEFINE_STATIC (hostname);
static gchar *static_hostname = NULL;
-static GStaticMutex static_hostname_mutex = G_STATIC_MUTEX_INIT;
+G_LOCK_DEFINE_STATIC (static_hostname);
static gchar *pretty_hostname = NULL;
static gchar *icon_name = NULL;
-static GStaticMutex machine_info_mutex = G_STATIC_MUTEX_INIT;
+G_LOCK_DEFINE_STATIC (machine_info);
static gboolean
hostname_is_valid (const gchar *name)
@@ -123,7 +123,7 @@ on_handle_set_hostname (OpenrcSettingsdHostnamedHostname1 *hostname1,
goto end;
}
- g_static_mutex_lock (&hostname_mutex);
+ G_LOCK (hostname);
/* Don't allow an empty or invalid hostname */
if (!hostname_is_valid (name)) {
name = hostname;
@@ -135,13 +135,13 @@ on_handle_set_hostname (OpenrcSettingsdHostnamedHostname1 *hostname1,
g_dbus_method_invocation_return_dbus_error (invocation,
DBUS_ERROR_FAILED,
strerror (errsv));
- g_static_mutex_unlock (&hostname_mutex);
+ G_UNLOCK (hostname);
goto end;
}
g_strlcpy (hostname, name, HOST_NAME_MAX + 1);
openrc_settingsd_hostnamed_hostname1_complete_set_hostname (hostname1, invocation);
openrc_settingsd_hostnamed_hostname1_set_hostname (hostname1, hostname);
- g_static_mutex_unlock (&hostname_mutex);
+ G_UNLOCK (hostname);
end:
return TRUE;
@@ -169,7 +169,7 @@ on_handle_set_static_hostname (OpenrcSettingsdHostnamedHostname1 *hostname1,
goto end;
}
- g_static_mutex_lock (&static_hostname_mutex);
+ G_LOCK (static_hostname);
/* Don't allow an empty or invalid hostname */
if (!hostname_is_valid (name))
name = "localhost";
@@ -177,7 +177,7 @@ on_handle_set_static_hostname (OpenrcSettingsdHostnamedHostname1 *hostname1,
confd_file = shell_utils_trivial_new (SYSCONFDIR "/conf.d/hostname", &err);
if (confd_file == NULL) {
g_dbus_method_invocation_return_gerror (invocation, err);
- g_static_mutex_unlock (&static_hostname_mutex);
+ G_UNLOCK (static_hostname);
goto end;
}
@@ -188,13 +188,13 @@ on_handle_set_static_hostname (OpenrcSettingsdHostnamedHostname1 *hostname1,
g_dbus_method_invocation_return_dbus_error (invocation,
DBUS_ERROR_FAILED,
"Failed to set static hostname in " SYSCONFDIR "/conf.d/hostname");
- g_static_mutex_unlock (&static_hostname_mutex);
+ G_UNLOCK (static_hostname);
goto end;
}
if (!shell_utils_trivial_save (confd_file, &err)) {
g_dbus_method_invocation_return_gerror (invocation, err);
- g_static_mutex_unlock (&static_hostname_mutex);
+ G_UNLOCK (static_hostname);
goto end;
}
@@ -202,7 +202,7 @@ on_handle_set_static_hostname (OpenrcSettingsdHostnamedHostname1 *hostname1,
static_hostname = g_strdup (name);
openrc_settingsd_hostnamed_hostname1_complete_set_static_hostname (hostname1, invocation);
openrc_settingsd_hostnamed_hostname1_set_static_hostname (hostname1, static_hostname);
- g_static_mutex_unlock (&static_hostname_mutex);
+ G_UNLOCK (static_hostname);
end:
shell_utils_trivial_free (confd_file);
@@ -235,7 +235,7 @@ on_handle_set_machine_info (OpenrcSettingsdHostnamedHostname1 *hostname1,
goto end;
}
- g_static_mutex_lock (&machine_info_mutex);
+ G_LOCK (machine_info);
/* Don't allow a null pretty hostname */
if (name == NULL)
name = "";
@@ -243,7 +243,7 @@ on_handle_set_machine_info (OpenrcSettingsdHostnamedHostname1 *hostname1,
confd_file = shell_utils_trivial_new (SYSCONFDIR "/machine-info", &err);
if (confd_file == NULL) {
g_dbus_method_invocation_return_gerror (invocation, err);
- g_static_mutex_unlock (&machine_info_mutex);
+ G_UNLOCK (machine_info);
goto end;
}
@@ -253,13 +253,13 @@ on_handle_set_machine_info (OpenrcSettingsdHostnamedHostname1 *hostname1,
g_dbus_method_invocation_return_dbus_error (invocation,
DBUS_ERROR_FAILED,
"Failed to value in " SYSCONFDIR "/machine-info");
- g_static_mutex_unlock (&machine_info_mutex);
+ G_UNLOCK (machine_info);
goto end;
}
if (!shell_utils_trivial_save (confd_file, &err)) {
g_dbus_method_invocation_return_gerror (invocation, err);
- g_static_mutex_unlock (&machine_info_mutex);
+ G_UNLOCK (machine_info);
goto end;
}
@@ -274,7 +274,7 @@ on_handle_set_machine_info (OpenrcSettingsdHostnamedHostname1 *hostname1,
openrc_settingsd_hostnamed_hostname1_complete_set_icon_name (hostname1, invocation);
openrc_settingsd_hostnamed_hostname1_set_icon_name (hostname1, icon_name);
}
- g_static_mutex_unlock (&machine_info_mutex);
+ G_UNLOCK (machine_info);
end:
shell_utils_trivial_free (confd_file);
next reply other threads:[~2012-02-05 0:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-05 0:20 Alexandre Restovtsev [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-09-09 3:47 [gentoo-commits] proj/openrc-settingsd:master commit in: src/ Alexandre Rostovtsev
2012-09-08 0:20 Alexandre Restovtsev
2012-09-05 23:46 Alexandre Restovtsev
2012-09-05 21:19 Alexandre Restovtsev
2012-09-05 21:19 Alexandre Restovtsev
2012-09-05 21:19 Alexandre Restovtsev
2012-09-05 16:54 Alexandre Restovtsev
2012-03-19 3:03 Alexandre Restovtsev
2012-03-19 2:05 Alexandre Restovtsev
2012-03-18 11:02 Alexandre Restovtsev
2012-02-08 6:53 Alexandre Restovtsev
2012-02-08 5:57 Alexandre Restovtsev
2012-02-08 5:01 Alexandre Restovtsev
2012-02-06 10:24 Alexandre Restovtsev
2012-02-05 7:52 Alexandre Restovtsev
2012-01-29 23:22 Alexandre Restovtsev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8f23cc229ef22542624b08b8b7f28219d0c3a5f8.tetromino@gentoo \
--to=tetromino@gmail.com \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox