dtsession: also block HUP and PIPE when preparing to shutdown
[oweals/cde.git] / cde / programs / dtsession / SmUI.c
index 243996d01a22a36b3694b49028db4b9059c8dc57..ada4756816d5c773fd2def59c46a8705b2a72237 100644 (file)
@@ -1157,6 +1157,8 @@ ImmediateExit(
      */
 #if !defined(SVR4) && !defined(sco)
     old = sigblock(sigmask(SIGTERM));
+    sigblock(sigmask(SIGHUP));
+    sigblock(sigmask(SIGPIPE));
 #else
     old = sighold(SIGTERM);
 #endif
@@ -1208,6 +1210,11 @@ ImmediateExit(
 
        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);
@@ -1221,6 +1228,13 @@ ImmediateExit(
                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) {
        /*