[gconf] Fix errno usage
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Subject: [gconf] Fix errno usage
- Date: Tue, 5 May 2009 21:52:00 -0400 (EDT)
commit fa974a0c4a03fe7851c2d92cbc6ead17e4233de5
Author: Christian Persch <chpe gnome org>
Date: Mon Apr 27 09:57:06 2009 -0400
Fix errno usage
In gconf_get_lock_or_current_holder a call to gconf_set_error could
clobber errno before it was used. Fixes bug #579168.
---
gconf/gconf-internals.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gconf/gconf-internals.c b/gconf/gconf-internals.c
index 3d0fd07..9ef8031 100644
--- a/gconf/gconf-internals.c
+++ b/gconf/gconf-internals.c
@@ -2549,10 +2549,12 @@ gconf_get_lock_or_current_holder (const gchar *lock_directory,
if (g_mkdir (lock_directory, 0700) < 0 &&
errno != EEXIST)
{
+ int errsv = errno;
+
gconf_set_error (err,
GCONF_ERROR_LOCK_FAILED,
_("couldn't create directory `%s': %s"),
- lock_directory, g_strerror (errno));
+ lock_directory, g_strerror (errsv));
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]