specific display, otherwise False */
Boolean loggingOut; /* Is True if the current save is for
a logout; False otherwise. */
+
+ Boolean ExitComplete; /* JET - don't exit before we are ready... */
+
} GeneralData;
SmExit (
int exitStatus)
{
- if (smXSMP.saveState.saveComplete &&
- smXSMP.saveState.shutdown &&
- !smXSMP.saveState.shutdownCanceled)
- XSMPExit ();
-
- exit (exitStatus);
+ /* JET - needed to rework this to avoid exiting before we are
+ * *really* ready to
+ */
+ if (smGD.ExitComplete)
+ {
+ if (smXSMP.saveState.saveComplete &&
+ smXSMP.saveState.shutdown &&
+ !smXSMP.saveState.shutdownCanceled)
+ XSMPExit ();
+ exit(exitStatus);
+ }
+ else
+ return;
}
void
smGD.smState = IN_PROCESS;
smGD.programName = strdup (argv[0]);
+ /* JET - By default, we always want to leave when SmExit() is called. */
+ smGD.ExitComplete = True;
+
/*
* We report some errors before we call the DtInitialize procedure.
* The Dt initialize procedure sets this name. If we report
smGD.loggingOut = True;
+ /* JET - set this here so we don't exit prematurely (while
+ * handling our own SM exit callback - duh).
+ */
+ smGD.ExitComplete = False;
+
saveTimeout = False;
timerId = XtAppAddTimeOut (smGD.appCon, smRes.saveYourselfTimeout,
SaveTimeout, NULL);
XtDispatchEvent(&next);
}
}
+
+ /* JET - need this, since dtsession was exiting in the
+ * XtAppNextEvent above (receiving it's own EXIT SM message) This
+ * is checked in SmExit() so exit's will only occur after this
+ * housekeeping has been completed.
+ */
+ smGD.ExitComplete = True;
if (smXSMP.saveState.shutdownCanceled == False) {
/*