Backport a change from arping: on ctrl+c hit, display statistics

svn path=/trunk/; revision=70267
This commit is contained in:
Pierre Schweitzer 2015-12-04 13:02:36 +00:00
parent 2b39d4ecf5
commit 248a8191f1

View file

@ -352,6 +352,14 @@ static WORD Checksum(PUSHORT data, UINT size)
return (USHORT)(~sum);
}
static BOOL WINAPI StopLoop(DWORD dwCtrlType)
{
NeverStop = FALSE;
PingCount = 0;
return TRUE;
}
/* Prepare to ping target */
static BOOL Setup(VOID)
{
@ -439,6 +447,9 @@ static BOOL Setup(VOID)
MaxRTT.QuadPart = 0;
SumRTT.QuadPart = 0;
MinRTTSet = FALSE;
SetConsoleCtrlHandler(StopLoop, TRUE);
return TRUE;
}