aboutsummaryrefslogtreecommitdiff
path: root/src/Debug.hh
diff options
context:
space:
mode:
authorMathias Gumz <akira at fluxbox dot org>2014-02-18 18:34:35 (GMT)
committerMathias Gumz <akira at fluxbox dot org>2014-02-18 18:34:35 (GMT)
commit43bdf499d56c09a520dc3bc03438dee4092d3d58 (patch)
treefc08fe113eb7c577eb402bf9ffebd8038d4f90da /src/Debug.hh
parent3696562aa87c7e68cb8b00b85f0e8d5cf2d199bf (diff)
downloadfluxbox-43bdf499d56c09a520dc3bc03438dee4092d3d58.zip
fluxbox-43bdf499d56c09a520dc3bc03438dee4092d3d58.tar.bz2
Fix race condition on shutdown
This commit fixes primarily a race condition that occurs when xinit(1) shuts down: by not acting properly fluxbox gets caught in an infinite loop. It caused bug #1100. xinit(1) sends a SIGHUP signal to all processes. fluxbox tries to shutdown itself properly by shutting down workspaces and screens. While doing that, the Xserver might be gone already. Additionally, fluxbox used to restart() itself on SIGHUP, which is clearly not the right thing to do when xinit(1) is about to end the session. So, fluxbox does this: * handling SIGHUP now shuts down fluxbox without clearing workspaces and screens. * A 2 second alarm() is triggered in Fluxbox::shutdown() as a last resort * XSetIOErrorHandler() is used to recognize the disconnect from the xserver. * SIGUSR1 is for restarting fluxbox, SIGUSR2 for reloading the config * FbTk/SignalHandler.cc/hh is gone; this unused abstraction served currently no real purpose. Signal handling is now done in main.cc * Unrelated to the issue itself src/main.cc was trimmed down quite a bit and the code (responsible for handling the command line interface) was moved to src/cli*
Diffstat (limited to 'src/Debug.hh')
-rw-r--r--src/Debug.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Debug.hh b/src/Debug.hh
index 3688b52..556186f 100644
--- a/src/Debug.hh
+++ b/src/Debug.hh
@@ -1,10 +1,12 @@
1#ifndef DEBUG_HH 1#ifndef DEBUG_HH
2#define DEBUG_HH 2#define DEBUG_HH
3 3
4#ifdef HAVE_CONFIG_H
4#include "config.h" 5#include "config.h"
5#include <iostream> 6#endif // HAVE_CONFIG_H
6 7
7#ifdef DEBUG 8#ifdef DEBUG
9#include <iostream>
8#define fbdbg std::cerr<<__FILE__<<"("<<__LINE__<< "): " 10#define fbdbg std::cerr<<__FILE__<<"("<<__LINE__<< "): "
9#else 11#else
10#define fbdbg if (false) std::cerr 12#define fbdbg if (false) std::cerr