mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
fix(ui_client): check return code of dup()
gsrc/nvim/ui_client.c: In function ‘ui_client_start_server’:
gsrc/nvim/ui_client.c:68:5: warning: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
68 | dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(cherry picked from commit 4d654472e6
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
a99d5d17d5
commit
c0845343b6
@@ -65,7 +65,11 @@ uint64_t ui_client_start_server(int argc, char **argv)
|
||||
#ifdef MSWIN
|
||||
os_open_conin_fd();
|
||||
#else
|
||||
dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO);
|
||||
int fd = dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO);
|
||||
if (fd < 0) {
|
||||
return 0;
|
||||
}
|
||||
// FIXME: resource leak of fd
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user