mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07: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); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
parent
54f5602038
commit
4d654472e6
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user