mirror of
https://github.com/xemu-project/xemu.git
synced 2025-04-02 11:11:48 -04:00
block: Ignore close() failure in get_tmp_filename()
The temporary file has been created and is ready for use. Checking return value of close() does not seem useful. The file descriptor is almost certainly closed; see close(2) under "Dealing with error returns from close()". Let's simply ignore close() failure here. Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20221010040432.3380478-1-bin.meng@windriver.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
b885cdda79
commit
6b6471eee1
1 changed files with 1 additions and 4 deletions
5
block.c
5
block.c
|
@ -887,10 +887,7 @@ int get_tmp_filename(char *filename, int size)
|
|||
if (fd < 0) {
|
||||
return -errno;
|
||||
}
|
||||
if (close(fd) != 0) {
|
||||
unlink(filename);
|
||||
return -errno;
|
||||
}
|
||||
close(fd);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue