delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/02/19/12:32:26

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <36CD9E93.553E7BFB@pdi.com>
Date: Fri, 19 Feb 1999 09:25:39 -0800
From: Curtis Galloway <curtis AT pdi DOT com>
X-Mailer: Mozilla 4.5 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sourceware DOT cygnus DOT com
Subject: Handling CTRL_LOGOFF_EVENT

I submitted a fix a while ago to the winsup module regarding bash hanging when
I rebooted my NT machine.  The problem was that the cygwin signal handler was
returning TRUE after receiving a CTRL_CLOSE_EVENT or CTRL_SHUTDOWN_EVENT window
event, so Windows thought that cygwin programs refused to exit when you were
shutting down the system.  This resulted in Windows popping up a dialog box for
every open bash window asking if you wanted to kill the program.

That particular problem was fixed, but the problem still occurs if you log out
rather than shutting down the machine.  I have enclosed a patch below, which I
have been using for some time with no problems.

I haven't tested with programs that act as NT services, though, and I'm unsure
what the consequences of this change would be to such a program.  Anyone
writing NT services out there?

--Curtis



*** exceptions.cc.00    Fri Dec 04 04:35:03 1998
--- exceptions.cc       Wed Jan 27 15:45:54 1999
***************
*** 534,540 ****
    BOOL ret;

    if (type == CTRL_LOGOFF_EVENT)
!     return 1;

    if ((type == CTRL_CLOSE_EVENT) || (type == CTRL_SHUTDOWN_EVENT))
      /* Return FALSE to prevent an "End task" dialog box from appearing
--- 534,540 ----
    BOOL ret;

    if (type == CTRL_LOGOFF_EVENT)
!     return FALSE;

    if ((type == CTRL_CLOSE_EVENT) || (type == CTRL_SHUTDOWN_EVENT))
      /* Return FALSE to prevent an "End task" dialog box from appearing

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019