diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-05 22:58:28 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-05 22:59:40 -0400 |
commit | 4910ac9ab8984551391df78dbf2744e6b4f5ef67 (patch) | |
tree | b721ecc45c8e90aea7e75da528ccd34e55c68526 /src | |
parent | 5c6018ba2f6b447a2433a336aacfe75e57e307bc (diff) | |
download | rneovim-4910ac9ab8984551391df78dbf2744e6b4f5ef67.tar.gz rneovim-4910ac9ab8984551391df78dbf2744e6b4f5ef67.tar.bz2 rneovim-4910ac9ab8984551391df78dbf2744e6b4f5ef67.zip |
vim-patch:8.2.2828: Coverity complains about not checking rename() return value
Problem: Coverity complains about not checking the rename() return value.
Solution: Add "(void)", can't do anything in case of a failure.
https://github.com/vim/vim/commit/97a6c6a1fb6043fd6520fbaaafc6970334186167
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/fileio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 792ef81665..29c29a2884 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -4560,11 +4560,12 @@ int vim_rename(const char_u *from, const char_u *to) if (!os_path_exists(tempname)) { if (os_rename(from, tempname) == OK) { - if (os_rename(tempname, to) == OK) + if (os_rename(tempname, to) == OK) { return 0; - /* Strange, the second step failed. Try moving the - * file back and return failure. */ - os_rename(tempname, from); + } + // Strange, the second step failed. Try moving the + // file back and return failure. + (void)os_rename(tempname, from); return -1; } /* If it fails for one temp name it will most likely fail |