mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-04 23:54:09 +00:00
filebuf: Check the return value for close
This commit is contained in:
parent
d96c3863a5
commit
5daca042c6
@ -319,10 +319,15 @@ int git_filebuf_commit(git_filebuf *file, mode_t mode)
|
||||
if (verify_last_error(file) < 0)
|
||||
goto on_error;
|
||||
|
||||
p_close(file->fd);
|
||||
file->fd = -1;
|
||||
file->fd_is_open = false;
|
||||
|
||||
if (p_close(file->fd) < 0) {
|
||||
giterr_set(GITERR_OS, "Failed to close file at '%s'", file->path_lock);
|
||||
goto on_error;
|
||||
}
|
||||
|
||||
file->fd = -1;
|
||||
|
||||
if (p_chmod(file->path_lock, mode)) {
|
||||
giterr_set(GITERR_OS, "Failed to set attributes for file at '%s'", file->path_lock);
|
||||
goto on_error;
|
||||
|
Loading…
Reference in New Issue
Block a user