aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorThanos Makatos <thanos.makatos@nutanix.com>2022-08-08 11:39:32 +0100
committerGitHub <noreply@github.com>2022-08-08 11:39:32 +0100
commitff0ef3fb1ed7b206d0586071a88778110b245582 (patch)
tree06abf5d247c137dcfa45231f286bd1518d1e1ab7 /samples
parent1305f161b7e0dd2c2a420c17efcb0bd49b94dad4 (diff)
downloadlibvfio-user-ff0ef3fb1ed7b206d0586071a88778110b245582.zip
libvfio-user-ff0ef3fb1ed7b206d0586071a88778110b245582.tar.gz
libvfio-user-ff0ef3fb1ed7b206d0586071a88778110b245582.tar.bz2
delete socket on vfu_ctx_destroy (#702)
fixes #660 Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/gpio-pci-idio-16.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/samples/gpio-pci-idio-16.c b/samples/gpio-pci-idio-16.c
index 4872d3b..b50f407 100644
--- a/samples/gpio-pci-idio-16.c
+++ b/samples/gpio-pci-idio-16.c
@@ -243,6 +243,9 @@ main(int argc, char *argv[])
ret = vfu_attach_ctx(vfu_ctx);
if (ret < 0) {
+ int _errno = errno;
+ vfu_destroy_ctx(vfu_ctx);
+ errno = _errno;
err(EXIT_FAILURE, "failed to attach device");
}