summaryrefslogtreecommitdiff
path: root/engine/dconf-engine-source-system.c
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2013-11-25 11:37:24 -0500
committerRyan Lortie <desrt@desrt.ca>2013-11-25 12:23:16 -0500
commit048e2e5e9c89eb08ef954194f2a5505e3d4ace3a (patch)
tree4421b539bdefc57910fd54cca4d49dde1ab21063 /engine/dconf-engine-source-system.c
parentb7978d79b21340bb80725c6deb7e2aafba436175 (diff)
downloaddconf-048e2e5e9c89eb08ef954194f2a5505e3d4ace3a.tar.gz
engine: issue warnings once per source
On failure to open a gvdb file in /etc/dconf/db we would issue a warning once per process -- even if multiple files were missing. This was enforced using a static variable. An unfortunate side effect of this global state is that the testcases couldn't reliably know if to expect the error or not. This issue was side-stepped by running any cases that may emit the warning under a fork, but that made it difficult to debug some of the cases. Rework the backends not to use global state for the flag and instead store it per-source. Remove a use of g_test_trap_fork().
Diffstat (limited to 'engine/dconf-engine-source-system.c')
-rw-r--r--engine/dconf-engine-source-system.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/engine/dconf-engine-source-system.c b/engine/dconf-engine-source-system.c
index 5d48e7f..30e67eb 100644
--- a/engine/dconf-engine-source-system.c
+++ b/engine/dconf-engine-source-system.c
@@ -45,7 +45,6 @@ dconf_engine_source_system_needs_reopen (DConfEngineSource *source)
static GvdbTable *
dconf_engine_source_system_reopen (DConfEngineSource *source)
{
- static gboolean did_warn;
GError *error = NULL;
GvdbTable *table;
gchar *filename;
@@ -55,10 +54,10 @@ dconf_engine_source_system_reopen (DConfEngineSource *source)
if (table == NULL)
{
- if (!did_warn)
+ if (!source->did_warn)
{
g_warning ("unable to open file '%s': %s; expect degraded performance", filename, error->message);
- did_warn = TRUE;
+ source->did_warn = TRUE;
}
g_error_free (error);