diff options
| author | ruki <[email protected]> | 2020-11-12 22:19:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-12 22:19:19 +0800 |
| commit | ef8c228b9f176d140fffe0ecb8fe710c0d8d1ff9 (patch) | |
| tree | 6743ec8ba841b9db339016e4067fbfda4ff494f2 | |
| parent | 84d36ec8705fcd980dd8ba0e4ff263044e99c9dc (diff) | |
improve find_ping
| -rw-r--r-- | xmake/modules/detect/tools/find_ping.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/modules/detect/tools/find_ping.lua b/xmake/modules/detect/tools/find_ping.lua index a620c93a5..c0617056f 100644 --- a/xmake/modules/detect/tools/find_ping.lua +++ b/xmake/modules/detect/tools/find_ping.lua @@ -33,10 +33,12 @@ function main(opt) -- init options opt = opt or {} opt.check = opt.check or function (program) - if os.host() == "windows" then - os.run("%s -n 1 127.0.0.1", program) + if is_host("windows") then + os.run("%s -n 1 -w 500 127.0.0.1", program) + elseif is_host("macosx") then + os.run("%s -c 1 -t 1 127.0.0.1", program) else - os.run("%s -c 1 127.0.0.1", program) + os.run("%s -c 1 -W 1 127.0.0.1", program) end end |
