aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/executable_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2026-02-23 12:28:17 +0800
committerGitHub <noreply@github.com>2026-02-23 12:28:17 +0800
commit97509aa2be00b366f10fa4e97506e7b96d514345 (patch)
tree0837c6314c4dc6e927815b9ebaa6afd228496226 /test/functional/vimscript/executable_spec.lua
parentec24746406c4f02a6933e046a87b72d5129042a9 (diff)
downloadrneovim-97509aa2be00b366f10fa4e97506e7b96d514345.tar.gz
rneovim-97509aa2be00b366f10fa4e97506e7b96d514345.tar.bz2
rneovim-97509aa2be00b366f10fa4e97506e7b96d514345.zip
fix(process): handle poll() interrupted by a signal (#38024)
It is indeed possible that a signal may arrive during flush_stream() (e.g. SIGCHLD from another child process), so poll() again on EINTR. Fixes the following Coverity warning: _____________________________________________________________________________________________ *** CID 644345: Error handling issues (CHECKED_RETURN) /src/nvim/event/proc.c: 405 in flush_stream() 399 400 #ifdef __linux__ 401 // On Linux, libuv's polling (which uses epoll) doesn't flush PTY master's pending 402 // work on kernel workqueue, so use an explcit poll() before that. #37982 403 if (proc->type == kProcTypePty && !stream->did_eof) { 404 struct pollfd pollfd = { .fd = ((PtyProc *)proc)->tty_fd, .events = POLLIN }; >>> CID 644345: Error handling issues (CHECKED_RETURN) >>> Calling "poll(&pollfd, 1UL, 0)" without checking return value. This library function may fail and return an error code. 405 poll(&pollfd, 1, 0); 406 } 407 #endif 408 // Poll for data and process the generated events. 409 loop_poll_events(proc->loop, 0); 410 if (stream->s.events) { Another possible error is ENOMEM, which is probably not worth handling. For reference, #23308 previously removed a case of ENOMEM handling, and this PR also removes an outdated mention of that. Also reduce the number of #ifdefs in non-OS-specific files.
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions