diff options
author | Ryan Lortie <desrt@desrt.ca> | 2013-11-25 11:37:24 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-11-25 12:23:16 -0500 |
commit | 048e2e5e9c89eb08ef954194f2a5505e3d4ace3a (patch) | |
tree | 4421b539bdefc57910fd54cca4d49dde1ab21063 /engine/dconf-engine-source-system.c | |
parent | b7978d79b21340bb80725c6deb7e2aafba436175 (diff) | |
download | dconf-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.c | 5 |
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); |