Skip to content

Commit

Permalink
Merge pull request #2732 from t4-ravenbird/darwin-ping
Browse files Browse the repository at this point in the history
[fix] ping timeout option for darwin
  • Loading branch information
davilla committed May 12, 2013
2 parents 795a693 + a43a263 commit dd0cce0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xbmc/network/linux/NetworkLinux.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -535,7 +535,11 @@ bool CNetworkLinux::PingHost(unsigned long remote_ip, unsigned int timeout_ms)
struct in_addr host_ip; struct in_addr host_ip;
host_ip.s_addr = remote_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)); 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); int status = system (cmd_line);


Expand Down

0 comments on commit dd0cce0

Please sign in to comment.