summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-12-05 23:59:42 +0800
committerruki <[email protected]>2023-12-05 23:59:42 +0800
commitb8530e786b07ae81445b9fdacdd9a97e97511c83 (patch)
tree2d5983bb8ee120f2ce31b023ea12caf9d27e6994
parent9355235e1b2970cdad5a1230522464f2b29d7182 (diff)
improve ping #4470
-rw-r--r--xmake/modules/net/ping.lua6
1 files changed, 5 insertions, 1 deletions
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