rem: static int already_crashed = 0; int dumpcore = 0; #ifndef NO_EMERGENCY_AUTORESTART int crashAction, i; char *argv[2];  argv[1] = NULL; #endif
context: handleSig(int sig){    static int already_crashed = 0;    int dumpcore = 0;#ifndef NO_EMERGENCY_AUTORESTART    int crashAction, i;    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.     */#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;        /*         * Yeah, we shouldn't do this, but it's already crashed anyway :P         */#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) {            CARD32 data[2];            WWindow *wwin;            XGrabServer(dpy);            crashAction = wShowCrashingDialogPanel(sig);            /*             * Save current workspace, so can go back to it if restarting.             * Also add hint that we crashed, so that windows will be placed             * correctly upon restart.             */            for (i=0; i<wScreenCount; i++) {                data[0] = wScreen[i]->current_workspace; /* workspace number */                data[1] = WFLAGS_CRASHED; /* signal that we crashed */                XChangeProperty(dpy, wScreen[i]->root_win,                                _XA_WINDOWMAKER_STATE, _XA_WINDOWMAKER_STATE,                                32, PropModeReplace, (unsigned char*) data, 2);                /* save state of windows */                wwin = wScreen[i]->focused_window;                while (wwin) {                    wWindowSaveState(wwin);                    wwin = wwin->prev;                }            }            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..."));        for (i=0; i<WMGetArrayItemCount(wPreferences.fallbackWMs); i++) {            Restart(WMGetFromArray(wPreferences.fallbackWMs, i), 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);}