Re: apr and shutdown

"Mark Hahn" <[email protected]> Sun, 20 Jun 2004 01:05:33 -0700
Newsgroups gmane.comp.lang.prothon.devel
Message-ID <[email protected]>
Mark Hahn wrote:

> This code is documented in my visual studio and I put it in my code
> but it seems to do nothing.  sig_handler is never called.
>
> void sig_handler(int signum) {
>     switch (signum) {
>         case SIGTERM:
>             signum = 0; // for breakpoint
>     }
> }
>
> signal(SIGTERM, sig_handler);
> signal(SIGABRT, sig_handler);
> signal(SIGFPE, sig_handler);
> signal(SIGILL, sig_handler);
> signal(SIGINT, sig_handler);
> signal(SIGSEGV, sig_handler);
> signal(SIGTERM, sig_handler);

This code is working because the first time I got a segfault it broke with a
SIGSEGV in sig_handler.  So the problem must be that when I close the win32
console window no SIGTERM is being issued.

Does anyone know how I can get win32 to issue a SIG when the console is
closed?