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:
Jan Edmund Lazo 2021-05-05 22:58:28 -04:00
parent 5c6018ba2f
commit 4910ac9ab8
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -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