1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-20 20:09:11 +00:00

Teach gconf about local locks, and use them by default. This is mostly

taken from gconf2, and allows gconf1 applications (e.g. Galeon, GnuCash, etc.)
to work properly with gconfd-2.

Reviewed by:	Havoc Pennington <hp@redhat.com>
Obtained from:	gconf2 (mostly)
This commit is contained in:
Joe Marcus Clarke 2003-09-30 02:38:10 +00:00
parent b6a40f4e33
commit ad04004ff5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=89864
2 changed files with 52 additions and 4 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= gconf
PORTVERSION= 1.0.9
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= devel gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/GConf/1.0

View File

@ -1,5 +1,5 @@
--- gconf/gconf-internals.c.orig Thu Mar 14 22:39:51 2002
+++ gconf/gconf-internals.c Fri Sep 27 00:37:23 2002
--- gconf/gconf-internals.c.orig Mon Sep 29 22:35:14 2003
+++ gconf/gconf-internals.c Mon Sep 29 22:35:16 2003
@@ -28,6 +28,9 @@
#include <string.h>
#include <sys/stat.h>
@ -10,7 +10,30 @@
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -3040,6 +3043,8 @@
@@ -2948,7 +2951,21 @@
char*
gconf_get_daemon_dir (void)
{
- return g_strconcat (g_get_home_dir (), "/.gconfd", NULL);
+ if (gconf_use_local_locks ())
+ {
+ char *s;
+ char *subdir;
+
+ subdir = g_strconcat ("gconfd-", g_get_user_name (), NULL);
+
+ s = g_strconcat (g_get_tmp_dir (), G_DIR_SEPARATOR_S, subdir, NULL);
+
+ g_free (subdir);
+
+ return s;
+ }
+ else
+ return g_strconcat (g_get_home_dir (), "/.gconfd", NULL);
}
char*
@@ -3040,6 +3057,8 @@
if (gconf_file_exists (GCONF_BINDIR"/gconfd-2"))
argv[0] = g_strconcat (GCONF_BINDIR, "/gconfd-2", NULL);
@ -19,3 +42,28 @@
else
argv[0] = g_strconcat (GCONF_BINDIR, "/" GCONFD, NULL);
@@ -4357,4 +4376,24 @@
return FALSE;
else
return TRUE;
+}
+
+enum { UNKNOWN, LOCAL, NORMAL };
+
+gboolean
+gconf_use_local_locks (void)
+{
+ static int local_locks = UNKNOWN;
+
+ if (local_locks == UNKNOWN)
+ {
+ const char *l =
+ g_getenv ("GCONF_GLOBAL_LOCKS");
+
+ if (l && atoi (l) == 1)
+ local_locks = NORMAL;
+ else
+ local_locks = LOCAL;
+ }
+ return local_locks == LOCAL;
}