wininet: Use "ping -c 1" instead of "ping -w 1" for InternetCheckConnection.

Ken Thomases ken at codeweavers.com
Wed Feb 28 14:04:58 CST 2007


The former is more widely compatible than the latter.  On Mac OS X (and
probably other BSDs), there is no "-w <timeout>" switch.  The "-c <count>"
switch tries that many ping packets, and exits when they all expire.  It
accomplishes the same test, but it can be slower than the previous code.
---
  dlls/wininet/internet.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
-------------- next part --------------
diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c
index 436dd8b..e11fcb7 100644
--- a/dlls/wininet/internet.c
+++ b/dlls/wininet/internet.c
@@ -2699,7 +2699,7 @@ BOOL WINAPI InternetCheckConnectionW( LP
  */
 
   BOOL   rc = FALSE;
-  static const CHAR ping[] = "ping -w 1 ";
+  static const CHAR ping[] = "ping -c 1 ";
   static const CHAR redirect[] = " >/dev/null 2>/dev/null";
   CHAR *command = NULL;
   WCHAR hostW[1024];


More information about the wine-patches mailing list