all repos — fluxbox @ 76a1c5c161de5142ae468575dcba537f02d31686

custom fork of the fluxbox windowmanager

removed handleSignal, this is done in class Fluxbox now with FbTk SignalHandler
fluxgen fluxgen
commit

76a1c5c161de5142ae468575dcba537f02d31686

parent

bfbbac747848e3f31c12b9fe73712110d7ec4fdc

2 files changed, 3 insertions(+), 99 deletions(-)

jump to
M src/BaseDisplay.ccsrc/BaseDisplay.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: BaseDisplay.cc,v 1.16 2002/08/04 15:09:30 fluxgen Exp $ +// $Id: BaseDisplay.cc,v 1.17 2002/08/13 23:58:26 fluxgen Exp $ // use GNU extensions #ifndef _GNU_SOURCE

@@ -124,72 +124,6 @@

return(False); } - -// signal handler to allow for proper and gentle shutdown - -#ifndef HAVE_SIGACTION -static RETSIGTYPE signalhandler(int sig) { -#else // HAVE_SIGACTION -static void signalhandler(int sig) { -#endif // HAVE_SIGACTION - I18n *i18n = I18n::instance(); - static int re_enter = 0; - - switch (sig) { - case SIGCHLD: // we don't want the child process to kill us - int status; - waitpid(-1, &status, WNOHANG | WUNTRACED); - - #ifndef HAVE_SIGACTION - // assume broken, braindead sysv signal semantics - signal(SIGCHLD, (RETSIGTYPE (*)(int)) signalhandler); - #endif // HAVE_SIGACTION - - break; - - default: - if (base_display->handleSignal(sig)) { - - #ifndef HAVE_SIGACTION - // assume broken, braindead sysv signal semantics - signal(sig, (RETSIGTYPE (*)(int)) signalhandler); - #endif // HAVE_SIGACTION - - return; - } - - fprintf(stderr, - i18n->getMessage( - FBNLS::BaseDisplaySet, FBNLS::BaseDisplaySignalCaught, - "%s: signal %d caught\n"), - base_display->getApplicationName(), sig); - - if (! base_display->isStartup() && ! re_enter) { - internal_error = True; - - re_enter = 1; - fprintf(stderr, - i18n->getMessage( - FBNLS::BaseDisplaySet, FBNLS::BaseDisplayShuttingDown, - "shutting down\n")); - base_display->shutdown(); - } - - if (sig != SIGTERM && sig != SIGINT) { - fprintf(stderr, - i18n->getMessage( - FBNLS::BaseDisplaySet, FBNLS::BaseDisplayAborting, - "aborting... dumping core\n")); - abort(); - } - - exit(0); - - break; - } -} - - // convenience functions #ifndef __EMX__ void bexec(const char *command, char *displaystring) {

@@ -212,32 +146,6 @@

last_bad_window = None; I18n *i18n = I18n::instance(); ::base_display = this; - -#ifdef HAVE_SIGACTION - struct sigaction action; - - action.sa_handler = signalhandler; - action.sa_mask = sigset_t(); - action.sa_flags = SA_NOCLDSTOP | SA_NODEFER; - - sigaction(SIGSEGV, &action, NULL); - sigaction(SIGFPE, &action, NULL); - sigaction(SIGTERM, &action, NULL); - sigaction(SIGINT, &action, NULL); - sigaction(SIGCHLD, &action, NULL); - sigaction(SIGHUP, &action, NULL); - sigaction(SIGUSR1, &action, NULL); - sigaction(SIGUSR2, &action, NULL); -#else // !HAVE_SIGACTION - signal(SIGSEGV, (RETSIGTYPE (*)(int)) signalhandler); - signal(SIGFPE, (RETSIGTYPE (*)(int)) signalhandler); - signal(SIGTERM, (RETSIGTYPE (*)(int)) signalhandler); - signal(SIGINT, (RETSIGTYPE (*)(int)) signalhandler); - signal(SIGUSR1, (RETSIGTYPE (*)(int)) signalhandler); - signal(SIGUSR2, (RETSIGTYPE (*)(int)) signalhandler); - signal(SIGHUP, (RETSIGTYPE (*)(int)) signalhandler); - signal(SIGCHLD, (RETSIGTYPE (*)(int)) signalhandler); -#endif // HAVE_SIGACTION if (! (m_display = XOpenDisplay(dpy_name))) { fprintf(stderr,
M src/BaseDisplay.hhsrc/BaseDisplay.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: BaseDisplay.hh,v 1.23 2002/08/04 15:09:30 fluxgen Exp $ +// $Id: BaseDisplay.hh,v 1.24 2002/08/13 23:58:26 fluxgen Exp $ #ifndef BASEDISPLAY_HH #define BASEDISPLAY_HH

@@ -97,7 +97,7 @@ inline const char *getXDisplayName() const { return m_display_name; }

inline const char *getApplicationName() const { return m_app_name; } inline int getNumberOfScreens() const { return number_of_screens; } - inline int getShapeEventBase() const { return shape.event_basep; } + inline int getShapeEventBase() const { return shape.event_basep; } inline void shutdown() { m_shutdown = true; } inline void run() { m_startup = m_shutdown = false; }

@@ -107,10 +107,6 @@

void grab(); void ungrab(); void eventLoop(); - - // another pure virtual... this is used to handle signals that BaseDisplay - // doesn't understand itself - virtual Bool handleSignal(int) = 0; class GrabGuard:private NotCopyable {