Skip to content

Commit

Permalink
Merge pull request xmake-io#5929 from Redbeanw44602/dev
Browse files Browse the repository at this point in the history
fix speed test under non-english linux.
  • Loading branch information
waruqi authored Dec 5, 2024
2 parents b4017ff + 8050725 commit a9b53eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xmake/modules/net/ping.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ 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 }
end
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())
Expand Down

0 comments on commit a9b53eb

Please sign in to comment.