From ef8c228b9f176d140fffe0ecb8fe710c0d8d1ff9 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 12 Nov 2020 22:19:19 +0800 Subject: improve find_ping --- xmake/modules/detect/tools/find_ping.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'xmake/modules') 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 -- cgit v1.3.1