Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2732 from t4-ravenbird/darwin-ping

[fix] ping timeout option for darwin
  • Loading branch information...
commit dd0cce0d7a6ededa2844d0f4c79c39ebee582fe8 2 parents 795a693 + a43a263
davilla davilla authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 xbmc/network/linux/NetworkLinux.cpp
4 xbmc/network/linux/NetworkLinux.cpp
View
@@ -535,7 +535,11 @@ bool CNetworkLinux::PingHost(unsigned long remote_ip, unsigned int timeout_ms)
struct in_addr host_ip;
host_ip.s_addr = remote_ip;
+#if defined(TARGET_DARWIN)
+ sprintf(cmd_line, "ping -c 1 -t %d %s", timeout_ms / 1000 + (timeout_ms % 1000) != 0, inet_ntoa(host_ip));
+#else
sprintf(cmd_line, "ping -c 1 -w %d %s", timeout_ms / 1000 + (timeout_ms % 1000) != 0, inet_ntoa(host_ip));
+#endif
int status = system (cmd_line);
Please sign in to comment.
Something went wrong with that request. Please try again.