summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-12-05 17:45:12 +0800
committerGitHub <[email protected]>2024-12-05 17:45:12 +0800
commita9b53ebdf71740895e4dc91d91f5d2e641394b85 (patch)
tree6a102c12f2ed0dfac7dc407e8d99a4edfa202324
parentb4017ff0b4e2abb4737c0137d5079b7593c819b8 (diff)
parent80507252590a9e98c8cc1a2ac04f1fcd987e5ed0 (diff)
Merge pull request #5929 from Redbeanw44602/dev
fix speed test under non-english linux.
-rw-r--r--xmake/modules/net/ping.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/modules/net/ping.lua b/xmake/modules/net/ping.lua
index 756ee76ff..689bf4d94 100644
--- a/xmake/modules/net/ping.lua
+++ b/xmake/modules/net/ping.lua
@@ -31,7 +31,7 @@ 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
- -- https://github.com/xmake-io/xmake/issues/4470#issuecomment-1840338777
+ -- @see 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 }
@@ -39,7 +39,7 @@ function _ping(ping, host)
end
local timeval = "65535"
if data then
- timeval = data:match("time[=<]([%d%s%.]-)ms", 1, true) or data:match("[=<]([%d%s%.]-)ms TTL", 1, true) or "65535"
+ timeval = data:match("= [^/]+/([^/]+)/", 1, true) or data:match("[=<]([%d%s%.]-)ms TTL", 1, true) or "65535"
end
if timeval then
timeval = tonumber(timeval:trim())