aboutsummaryrefslogtreecommitdiff
path: root/lib/pci.c
diff options
context:
space:
mode:
authorMattias Nissler <122288598+mnissler-rivos@users.noreply.github.com>2023-08-15 13:38:30 +0200
committerGitHub <noreply@github.com>2023-08-15 12:38:30 +0100
commite8c37f83fb92848f328e297ace37536253ee08bc (patch)
treeff61bba39e20b62240e46b95504d2f1f6f4671c1 /lib/pci.c
parent1cca91aeb8ae8f531f9c3b9c59d83630e9941a5e (diff)
downloadlibvfio-user-e8c37f83fb92848f328e297ace37536253ee08bc.zip
libvfio-user-e8c37f83fb92848f328e297ace37536253ee08bc.tar.gz
libvfio-user-e8c37f83fb92848f328e297ace37536253ee08bc.tar.bz2
Introduce close_safely helper function (#763)
The helper function centralizes some extra checks and diligence desired by many/most current code paths but currently inconsistently applied. This includes bypassing the close call when the file descriptor is -1 already, resetting the file descriptor variable to -1 after closing, and preserving errno. All calls to close are replaced by close_safely. Some warning log output is lost over this, but it doesn't seem like this was very useful anyways given that Linux always closes the file descriptor anyways. Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
Diffstat (limited to 'lib/pci.c')
0 files changed, 0 insertions, 0 deletions