mirror of
https://github.com/neovim/neovim.git
synced 2025-12-12 01:22:41 +00:00
fix: type fixes
Type fixes caught by emmylua
This commit is contained in:
committed by
Lewis Russell
parent
4c333fdbb7
commit
3b6084ddf4
@@ -79,22 +79,19 @@ function SystemObj:_timeout(signal)
|
||||
self:kill(signal or SIG.TERM)
|
||||
end
|
||||
|
||||
-- Use max 32-bit signed int value to avoid overflow on 32-bit systems. #31633
|
||||
local MAX_TIMEOUT = 2 ^ 31 - 1
|
||||
|
||||
--- @param timeout? integer
|
||||
--- @return vim.SystemCompleted
|
||||
function SystemObj:wait(timeout)
|
||||
local state = self._state
|
||||
|
||||
local done = vim.wait(timeout or state.timeout or MAX_TIMEOUT, function()
|
||||
local done = vim.wait(timeout or state.timeout or vim._maxint, function()
|
||||
return state.result ~= nil
|
||||
end, nil, true)
|
||||
|
||||
if not done then
|
||||
-- Send sigkill since this cannot be caught
|
||||
self:_timeout(SIG.KILL)
|
||||
vim.wait(timeout or state.timeout or MAX_TIMEOUT, function()
|
||||
vim.wait(timeout or state.timeout or vim._maxint, function()
|
||||
return state.result ~= nil
|
||||
end, nil, true)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user