neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 045422e4a081e9dedff014346cc32eaef45e04e1
parent ed1a9c310df178e1163c910f70b194a657ad055a
Author: Charlie Groves <charlie.groves@gmail.com>
Date:   Tue,  1 Mar 2022 15:58:42 -0500

fix: respect os_proc_children rv of pid not found

os_proc_children returns 2 if there's a failure in the underlying
syscall. Only shell out to pgrep in that case.

It returns 1 if the pid isn't found. In that case, we can roll forward
with returning an empty list.

Diffstat:
Msrc/nvim/api/vim.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c @@ -1991,7 +1991,7 @@ Array nvim_get_proc_children(Integer pid, Error *err) size_t proc_count; int rv = os_proc_children((int)pid, &proc_list, &proc_count); - if (rv != 0) { + if (rv == 2) { // syscall failed (possibly because of kernel options), try shelling out. DLOG("fallback to vim._os_proc_children()"); Array a = ARRAY_DICT_INIT;