diff options
author | Stefano Stabellini | 2017-05-09 21:04:53 +0200 |
---|---|---|
committer | Stefano Stabellini | 2017-05-16 20:51:25 +0200 |
commit | 01cd90b641e1aed40cf13a577e6a737af94d55e7 (patch) | |
tree | a7990f0fee16df75f5866067a127fc545cc48965 /hw/9pfs | |
parent | xen/9pfs: fix two resource leaks on error paths, discovered by Coverity (diff) | |
download | qemu-01cd90b641e1aed40cf13a577e6a737af94d55e7.tar.gz qemu-01cd90b641e1aed40cf13a577e6a737af94d55e7.tar.xz qemu-01cd90b641e1aed40cf13a577e6a737af94d55e7.zip |
xen: call qemu_set_cloexec instead of fcntl
Use the common utility function, which contains checks on return values
and first calls F_GETFD as recommended by POSIX.1-2001, instead of
manually calling fcntl.
CID: 1374831
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
CC: anthony.perard@citrix.com
CC: groug@kaod.org
CC: aneesh.kumar@linux.vnet.ibm.com
CC: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'hw/9pfs')
-rw-r--r-- | hw/9pfs/xen-9p-backend.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index a1fdedecc6..5df97c90fa 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -380,7 +380,7 @@ static int xen_9pfs_connect(struct XenDevice *xendev) if (xen_9pdev->rings[i].evtchndev == NULL) { goto out; } - fcntl(xenevtchn_fd(xen_9pdev->rings[i].evtchndev), F_SETFD, FD_CLOEXEC); + qemu_set_cloexec(xenevtchn_fd(xen_9pdev->rings[i].evtchndev)); xen_9pdev->rings[i].local_port = xenevtchn_bind_interdomain (xen_9pdev->rings[i].evtchndev, xendev->dom, |