Minor changes to assertion handling

Changed the code to bring back assertion popups for everyone, but turn
off assertions around the _get_osfhandle() call in allocate_sfd().  The
original port code was designed knowing that some of the passed
parameters would be invalid, but was expecting that the call would just
fail instead of generating an assert dialog.  Turning off Asserts around
this call results in behavior similar to mingw.

Also, turn off Incremental Linking for ssh.exe since half the time, the
linker would trap on this project.
This commit is contained in:
dkulwin 2015-12-08 12:47:29 -06:00
parent a08b1c8a7c
commit 702daceea7
3 changed files with 13 additions and 9 deletions

View File

@ -72,13 +72,13 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<TargetName>ssh</TargetName>
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<LinkIncremental>false</LinkIncremental>
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
<TargetName>ssh</TargetName>
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>

View File

@ -32,7 +32,9 @@
#include <winsock2.h>
#include <io.h>
#include "sfds.h"
#ifndef __MINGW32__
#include <Crtdbg.h>
#endif
extern void debug(const char *fmt,...);
extern void debug2(const char *fmt,...);
@ -156,12 +158,14 @@ int allocate_sfd(int fd_or_handle)
_invalid_parameter_handler oldHandler, newHandler;
newHandler = myInvalidParameterHandler;
oldHandler = _set_invalid_parameter_handler(newHandler);
int iPrev = _CrtSetReportMode(_CRT_ASSERT, 0);
#endif
real_handle = (HANDLE)_get_osfhandle(fd_or_handle);
#ifndef __MINGW32__
_set_invalid_parameter_handler(oldHandler);
_CrtSetReportMode(_CRT_ASSERT, iPrev);
#endif
if (real_handle == INVALID_HANDLE_VALUE)

View File

@ -2923,12 +2923,12 @@ void WSHELPinitialize()
winsock_initialized = 1;
#ifndef __MINGW32__
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
// _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
// _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
// _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
// _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
// _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
// _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
#endif