rem: int r;
add: int r, oldSaveSessionFlag;
context: shutdownCommand(WMenu *menu, WMenuEntry *entry){    static int inside = 0;    int result;    /* prevent reentrant calls */    if (inside)	return;    inside = 1;#define R_CANCEL 0#define R_CLOSE 1#define R_KILL 2        result = R_CANCEL;    if ((long)entry->clientdata==M_QUICK)	result = R_CLOSE;    else {#ifdef XSMP_ENABLED	if (wSessionIsManaged()) {	    int r;	    	    r = wMessageDialog(menu->frame->screen_ptr, 			       _("Close X session"), 			       _("Close Window System session?\n"				 "Kill might close applications with unsaved data."),			       _("Close"), _("Kill"), _("Cancel"));	    if (r==WAPRDefault)		result = R_CLOSE;	    else if (r==WAPRAlternate)		result = R_KILL;	} else#endif	{	    int r;	    r = wMessageDialog(menu->frame->screen_ptr, 			       _("Kill X session"), 			       _("Kill Window System session?\n"				 "(all applications will be closed)"),			       _("Kill"), _("Cancel"), NULL);	    if (r==WAPRDefault)		result = R_KILL;	}    }         if (result!=R_CANCEL) {#ifdef XSMP_ENABLED	if (result == R_CLOSE) {	    Shutdown(WSLogoutMode);	} else #endif /* XSMP_ENABLED */	{	    Shutdown(WSKillMode);	}    }#undef R_CLOSE#undef R_CANCEL#undef R_KILL    inside = 0;}