This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

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@sourceware.cygnus.com