mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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.
97a6c6a1fb
This commit is contained in:
parent
5c6018ba2f
commit
4910ac9ab8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user