Skip to content

Commit

Permalink
fix(libuv): potential race condition due to a553cfd
Browse files Browse the repository at this point in the history
Not sure if this can ever happen but this seems safer
  • Loading branch information
ibhagwan committed Jan 2, 2025
1 parent e532d95 commit c773fab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/fzf-lua/libuv.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ M.spawn = function(opts, fn_transform, fn_done)
-- can fail with premature process kill
-- assert(not err)
finish(130, 0, 2, pid)
elseif write_cb_count == 0 and on_exit_called then
elseif write_cb_count == 0 and not output_pipe:is_active() and on_exit_called then
-- spawn callback already called and did not close the pipe
-- due to write_cb_count>0, since this is the last call
-- we can close the fzf pipe
Expand Down

0 comments on commit c773fab

Please sign in to comment.