From b8530e786b07ae81445b9fdacdd9a97e97511c83 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 5 Dec 2023 23:59:42 +0800 Subject: improve ping #4470 --- xmake/modules/net/ping.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xmake/modules/net/ping.lua b/xmake/modules/net/ping.lua index d90b9e62b..756ee76ff 100644 --- a/xmake/modules/net/ping.lua +++ b/xmake/modules/net/ping.lua @@ -31,7 +31,11 @@ function _ping(ping, host) elseif is_host("macosx") then data = try { function () return os.iorun("%s -c 1 -t 1 %s", ping.program, host) end } else - data = try { function () return os.iorun("%s -c 1 -W 1 %s", ping.program, host) end } + -- https://github.com/xmake-io/xmake/issues/4470#issuecomment-1840338777 + data = try { function () return os.iorun("%s -c 1 -W 1 -n %s", ping.program, host) end } + if not data then + data = try { function () return os.iorun("%s -c 1 -W 1 %s", ping.program, host) end } + end end local timeval = "65535" if data then -- cgit v1.3.1