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:
parent
a08b1c8a7c
commit
702daceea7
|
@ -72,13 +72,13 @@
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
||||||
<TargetName>ssh</TargetName>
|
<TargetName>ssh</TargetName>
|
||||||
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
|
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
<IntDir>$(Platform)\$(Configuration)\$(TargetName)\</IntDir>
|
||||||
<TargetName>ssh</TargetName>
|
<TargetName>ssh</TargetName>
|
||||||
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
|
<OutDir>$(OpenSSH-Bin-Path)$(Platform)\$(Configuration)\</OutDir>
|
||||||
|
|
|
@ -32,7 +32,9 @@
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include "sfds.h"
|
#include "sfds.h"
|
||||||
|
#ifndef __MINGW32__
|
||||||
|
#include <Crtdbg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
extern void debug(const char *fmt,...);
|
extern void debug(const char *fmt,...);
|
||||||
extern void debug2(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;
|
_invalid_parameter_handler oldHandler, newHandler;
|
||||||
newHandler = myInvalidParameterHandler;
|
newHandler = myInvalidParameterHandler;
|
||||||
oldHandler = _set_invalid_parameter_handler(newHandler);
|
oldHandler = _set_invalid_parameter_handler(newHandler);
|
||||||
|
int iPrev = _CrtSetReportMode(_CRT_ASSERT, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
real_handle = (HANDLE)_get_osfhandle(fd_or_handle);
|
real_handle = (HANDLE)_get_osfhandle(fd_or_handle);
|
||||||
#ifndef __MINGW32__
|
#ifndef __MINGW32__
|
||||||
_set_invalid_parameter_handler(oldHandler);
|
_set_invalid_parameter_handler(oldHandler);
|
||||||
|
_CrtSetReportMode(_CRT_ASSERT, iPrev);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (real_handle == INVALID_HANDLE_VALUE)
|
if (real_handle == INVALID_HANDLE_VALUE)
|
||||||
|
|
|
@ -2923,12 +2923,12 @@ void WSHELPinitialize()
|
||||||
winsock_initialized = 1;
|
winsock_initialized = 1;
|
||||||
|
|
||||||
#ifndef __MINGW32__
|
#ifndef __MINGW32__
|
||||||
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
|
// _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
|
||||||
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
|
// _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
|
||||||
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
|
// _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
|
||||||
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
|
// _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
|
||||||
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
|
// _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
|
||||||
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
|
// _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue