Avoid double dialogs in OpenSSLDie on Windows.
authorAndy Polyakov <appro@openssl.org>
Sun, 3 May 2009 14:16:40 +0000 (14:16 +0000)
committerAndy Polyakov <appro@openssl.org>
Sun, 3 May 2009 14:16:40 +0000 (14:16 +0000)
crypto/cryptlib.c

index bb54e6485ad0efa18dbcaac1f0dc05120ea54489..901b87a4dd2c78b5ae96fb63b4ac6c7058ccd21a 100644 (file)
@@ -753,6 +753,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason,
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #include <tchar.h>
+#include <signal.h>
 
 #if defined(_WIN32_WINNT) && _WIN32_WINNT>=0x0333
 int OPENSSL_isservice(void)
@@ -883,7 +884,13 @@ void OpenSSLDie(const char *file,int line,const char *assertion)
        OPENSSL_showfatal(
                "%s(%d): OpenSSL internal error, assertion failed: %s\n",
                file,line,assertion);
+#if !defined(_WIN32)
        abort();
+#else
+       /* Win32 customarily shows a dialog, but we just did that... */
+       raise(SIGABRT);
+       _exit(3);
+#endif
        }
 
 void *OPENSSL_stderr(void)     { return stderr; }