rem: if (sig == SIGUSR1) { #ifdef SYS_SIGLIST_DECLARED wwarning(_("got signal %i (%s) - restarting\n"), sig, sys_siglist[sig]); #else wwarning(_("got signal %i - restarting\n"), sig); #endif  WCHANGE_STATE(WSTATE_NEED_RESTART);  if (!WDelayedActionSet) { WDelayedActionSet = 1; WMAddIdleHandler(delayedAction, NULL); } return; } else if (sig == SIGUSR2) { #ifdef SYS_SIGLIST_DECLARED wwarning(_("got signal %i (%s) - rereading defaults\n"), sig, sys_siglist[sig]); #else wwarning(_("got signal %i - rereading defaults\n"), sig); #endif  WCHANGE_STATE(WSTATE_NEED_REREAD);  if (!WDelayedActionSet) { WDelayedActionSet = 1; WMAddIdleHandler(delayedAction, NULL); } return; } else if (sig == SIGTERM || sig == SIGHUP) { #ifdef SYS_SIGLIST_DECLARED wwarning(_("got signal %i (%s) - exiting...\n"), sig, sys_siglist[sig]); #else wwarning(_("got signal %i - exiting...\n"), sig); #endif  WCHANGE_STATE(WSTATE_NEED_EXIT);  if (!WDelayedActionSet) { WDelayedActionSet = 1; WMAddIdleHandler(delayedAction, NULL); } return; }
context: handleSig(int sig){    static int already_crashed = 0;    int dumpcore = 0;#ifndef NO_EMERGENCY_AUTORESTART    int crashAction;    char *argv[2];        argv[1] = NULL;#endif        /*      * No functions that potentially do Xlib calls should be called from     * here. Xlib calls are not reentrant so the integrity of Xlib is     * not guaranteed if a Xlib call is made from a signal handler.     */    if (sig == SIGUSR1) {#ifdef SYS_SIGLIST_DECLARED        wwarning(_("got signal %i (%s) - restarting\n"), sig, sys_siglist[sig]);#else        wwarning(_("got signal %i - restarting\n"), sig);#endif	WCHANGE_STATE(WSTATE_NEED_RESTART);	/* setup idle handler, so that this will be handled when	 * the select() is returned becaused of the signal, even if	 * there are no X events in the queue */	if (!WDelayedActionSet) {	    WDelayedActionSet = 1;	    WMAddIdleHandler(delayedAction, NULL);	}        return;    } else if (sig == SIGUSR2) {#ifdef SYS_SIGLIST_DECLARED        wwarning(_("got signal %i (%s) - rereading defaults\n"), sig, sys_siglist[sig]);#else        wwarning(_("got signal %i - rereading defaults\n"), sig);#endif        WCHANGE_STATE(WSTATE_NEED_REREAD);        /* setup idle handler, so that this will be handled when         * the select() is returned becaused of the signal, even if         * there are no X events in the queue */        if (!WDelayedActionSet) {            WDelayedActionSet = 1;            WMAddIdleHandler(delayedAction, NULL);	}        return;    } else if (sig == SIGTERM || sig == SIGHUP) {#ifdef SYS_SIGLIST_DECLARED        wwarning(_("got signal %i (%s) - exiting...\n"), sig, sys_siglist[sig]);#else        wwarning(_("got signal %i - exiting...\n"), sig);#endif	WCHANGE_STATE(WSTATE_NEED_EXIT);	if (!WDelayedActionSet) {	    WDelayedActionSet = 1;	    WMAddIdleHandler(delayedAction, NULL);	}	return;    }#ifdef SYS_SIGLIST_DECLARED    wfatal(_("got signal %i (%s)\n"), sig, sys_siglist[sig]);#else    wfatal(_("got signal %i\n"), sig);#endif    /* Setting the signal behaviour back to default and then reraising the     * signal is a cleaner way to make program exit and core dump than calling     * abort(), since it correctly returns from the signal handler and sets     * the flags accordingly. -Dan     */    if (sig==SIGSEGV || sig==SIGFPE || sig==SIGBUS || sig==SIGILL	|| sig==SIGABRT) {	if (already_crashed) {	    wfatal(_("crashed while trying to do some post-crash cleanup. Aborting immediatelly."));            signal(sig, SIG_DFL);            kill(getpid(), sig);            return;	}	already_crashed = 1;	dumpcore = 1;#ifndef NO_EMERGENCY_AUTORESTART        /* Close the X connection and open a new one. This is to avoid messing         * Xlib because we call to Xlib functions in a signal handler.         */        if (dpy)            XCloseDisplay(dpy);        dpy = XOpenDisplay("");        if (dpy) {	    XGrabServer(dpy);            crashAction = wShowCrashingDialogPanel(sig);            XCloseDisplay(dpy);            dpy = NULL;        } else {            wsyserror(_("cannot open connection for crashing dialog panel. Aborting."));            crashAction = WMAbort;        }        if (crashAction == WMAbort) {            signal(sig, SIG_DFL);            kill(getpid(), sig);            return;        }        if (crashAction == WMRestart) {            /* we try to restart Window Maker */            wmessage(_("trying to restart Window Maker..."));            Restart(NULL, False);            /* fallback to alternate window manager then */        }    	wmessage(_("trying to start alternate window manager..."));        Restart(FALLBACK_WINDOWMANAGER, False);        Restart("fvwm", False);        Restart("twm", False);        wfatal(_("failed to start alternate window manager. Aborting."));#else        wfatal(_("a fatal error has occured, probably due to a bug. "                 "Please fill the included BUGFORM and report it."));#endif /* !NO_EMERGENCY_AUTORESTART */        signal(sig, SIG_DFL);        kill(getpid(), sig);        return;    }    wAbort(dumpcore);}