diff options
| author | ruki <[email protected]> | 2018-09-21 21:04:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-09-21 00:29:33 +0800 |
| commit | b05bfd4eb937e7a7d78201921ab86c165af00491 (patch) | |
| tree | 45c2d182516dd1364e50dba116de25c70bd8d44b | |
| parent | c0427ff121f8676d9ba59256835fe73933601e06 (diff) | |
fix ping
| -rw-r--r-- | xmake/modules/net/ping.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/xmake/modules/net/ping.lua b/xmake/modules/net/ping.lua index 94bf58b64..f4c273cc2 100644 --- a/xmake/modules/net/ping.lua +++ b/xmake/modules/net/ping.lua @@ -69,10 +69,12 @@ function main(hosts, opt) else -- ping it, timeout: 1s local data = nil - if os.host() == "windows" then + if is_host("windows") then data = os.iorun("%s -n 1 -w 1000 %s", ping, host) - else + elseif is_host("macosx") then data = os.iorun("%s -c 1 -t 1 %s", ping, host) + else + data = os.iorun("%s -c 1 -W 1 %s", ping, host) end -- find time @@ -99,6 +101,9 @@ function main(hosts, opt) if cacheinfo then cacheinfo[host] = timeval end + + -- trace + vprint("pinging for the host(%s) ... %d ms", host, timeval) end } } |
