Author: pschweitzer
Date: Fri Dec 4 13:02:36 2015
New Revision: 70267
URL:
http://svn.reactos.org/svn/reactos?rev=70267&view=rev
Log:
[PING]
Backport a change from arping: on ctrl+c hit, display statistics
Modified:
trunk/reactos/base/applications/network/ping/ping.c
Modified: trunk/reactos/base/applications/network/ping/ping.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ping/ping.c [iso-8859-1] Fri Dec 4 13:02:36
2015
@@ -352,6 +352,14 @@
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 @@
MaxRTT.QuadPart = 0;
SumRTT.QuadPart = 0;
MinRTTSet = FALSE;
+
+ SetConsoleCtrlHandler(StopLoop, TRUE);
+
return TRUE;
}