aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2010-09-18 15:51:30 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2010-09-18 15:51:30 (GMT)
commit0ef76292c5447127dc3fd39d6272f6d88a63d145 (patch)
tree167e28347f69bcc8db8dfc38f04a01f70f21df2b /util
parentc9c741c88da3cc5e74f0399c3c5c1f0e70163a7a (diff)
downloadfluxbox-0ef76292c5447127dc3fd39d6272f6d88a63d145.zip
fluxbox-0ef76292c5447127dc3fd39d6272f6d88a63d145.tar.bz2
changed the way we create the '~/.fluxbox' directory to avoid race conditions
before bringing up the first instance of Fluxbox we prepare the directory and the files it needs. if the config version of exiting files is lower than what we expect, we upgrade the config files. after that we bring up Fluxbox. the old way was problematic because setupConfigFiles() calls 'fluxbox-update_configs' which does its job in the background while fluxbox continues to boot. 'fluxbox-update_configs' sends a USR2 signal to the booting fluxbox (it might even be finished, no one knows) which triggers 'load_rc()' which triggered 'setupConfigFiles()' again which might trigger 'fluxbox-update_configs' again (on my machine 'fluxbox-update_configs' was called 3 times and left a pretty crippled 'keys' file when it was done). bootstrapping before bringing up fluxbox resolves the issue. as a bonus: no need to send USR2 to fluxbox to reload the config file because fluxbox has not even tried to read it yet.
Diffstat (limited to 'util')
-rw-r--r--util/fluxbox-update_configs.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/fluxbox-update_configs.cc b/util/fluxbox-update_configs.cc
index 292fe92..39539f8 100644
--- a/util/fluxbox-update_configs.cc
+++ b/util/fluxbox-update_configs.cc
@@ -563,7 +563,7 @@ int run_updates(int old_version, FbTk::ResourceManager &rm) {
563 string appsfilename = FbTk::StringUtil::expandFilename(*rc_appsfile); 563 string appsfilename = FbTk::StringUtil::expandFilename(*rc_appsfile);
564 string keyfilename = FbTk::StringUtil::expandFilename(*rc_keyfile); 564 string keyfilename = FbTk::StringUtil::expandFilename(*rc_keyfile);
565 565
566 size_t i; 566 int i;
567 for (i = 0; i < sizeof(UPDATES) / sizeof(Update); ++i) { 567 for (i = 0; i < sizeof(UPDATES) / sizeof(Update); ++i) {
568 if (old_version < UPDATES[i].version) { 568 if (old_version < UPDATES[i].version) {
569 UPDATES[i].update(rm, keyfilename, appsfilename); 569 UPDATES[i].update(rm, keyfilename, appsfilename);