summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@intel.com>2011-11-28 14:34:43 +0000
committerRoss Burton <ross@linux.intel.com>2011-11-28 14:35:50 +0000
commit635d28cbf635d89b8bbbb008bf86cc864b8dabb7 (patch)
treec86a5342e7e8a5edf5db5fdc71b67720226de04b
parentc129898afaa562ffc38f434e5e0c607f525101b8 (diff)
downloadgconf-635d28cbf635d89b8bbbb008bf86cc864b8dabb7.tar.gz
Allow the backend directory to be specified from the environment.
This is required in Yoctor so we can relocate gconf-native to different paths and still allow it to work. https://bugzilla.gnome.org/show_bug.cgi?id=664650
-rw-r--r--gconf/gconf-backend.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gconf/gconf-backend.c b/gconf/gconf-backend.c
index c11bb875..044c0f18 100644
--- a/gconf/gconf-backend.c
+++ b/gconf/gconf-backend.c
@@ -21,6 +21,7 @@
#include <config.h>
#include "gconf-backend.h"
#include "gconf-internals.h"
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
@@ -171,6 +172,7 @@ gconf_backend_file(const gchar* address)
gchar* back;
gchar* file;
gchar* retval;
+ const gchar* backenddir;
g_return_val_if_fail(address != NULL, NULL);
@@ -179,9 +181,13 @@ gconf_backend_file(const gchar* address)
if (back == NULL)
return NULL;
+ backenddir = g_getenv("GCONF_BACKEND_DIR");
+ if (backenddir == NULL)
+ backenddir = GCONF_BACKEND_DIR;
+
file = g_strconcat("gconfbackend-", back, NULL);
- retval = g_module_build_path(GCONF_BACKEND_DIR, file);
+ retval = g_module_build_path(backenddir, file);
g_free(back);