--------------------- PatchSet 7029 Date: 2005/09/13 15:54:47 Author: serassio Branch: nt-2_5 Tag: (none) Log: Updated native Windows exception handler. Backport of 3.0 changes. Members: src/tools.c:1.19.14.23->1.19.14.24 Index: squid/src/tools.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/tools.c,v retrieving revision 1.19.14.23 retrieving revision 1.19.14.24 diff -u -r1.19.14.23 -r1.19.14.24 --- squid/src/tools.c 11 Sep 2005 08:25:22 -0000 1.19.14.23 +++ squid/src/tools.c 13 Sep 2005 15:54:47 -0000 1.19.14.24 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.19.14.23 2005/09/11 08:25:22 serassio Exp $ + * $Id: tools.c,v 1.19.14.24 2005/09/13 15:54:47 serassio Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -784,19 +784,30 @@ debug(50, 0) ("sigaction: sig=%d func=%p: %s\n", sig, func, xstrerror()); #else #ifdef _SQUID_MSWIN_ + /* + On Windows, only SIGINT, SIGILL, SIGFPE, SIGTERM, SIGBREAK, SIGABRT and SIGSEGV signals + are supported, so we must care of don't call signal() for other value. + The SIGILL, SIGSEGV, and SIGTERM signals are not generated under Windows. They are defined + for ANSI compatibility, so both SIGSEGV and SIGBUS are emulated with an Exception Handler. + */ switch (sig) { case SIGINT: case SIGILL: case SIGFPE: - case SIGSEGV: case SIGTERM: case SIGBREAK: case SIGABRT: + break; + case SIGSEGV: WIN32_ExceptionHandlerInit(); break; + case SIGBUS: + WIN32_ExceptionHandlerInit(); + return; + break; /* Nor reached */ default: return; - break; /* Nor reached */ + break; /* Nor reached */ } #endif signal(sig, func);