From 01cd90b641e1aed40cf13a577e6a737af94d55e7 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Tue, 9 May 2017 12:04:53 -0700 Subject: 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 Reviewed-by: Eric Blake Reviewed-by: Greg Kurz CC: anthony.perard@citrix.com CC: groug@kaod.org CC: aneesh.kumar@linux.vnet.ibm.com CC: Eric Blake --- hw/xen/xen_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/xen') diff --git a/hw/xen/xen_backend.c b/hw/xen/xen_backend.c index c85f1637e4..2cac47d6c4 100644 --- a/hw/xen/xen_backend.c +++ b/hw/xen/xen_backend.c @@ -147,7 +147,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev, qdev_unplug(DEVICE(xendev), NULL); return NULL; } - fcntl(xenevtchn_fd(xendev->evtchndev), F_SETFD, FD_CLOEXEC); + qemu_set_cloexec(xenevtchn_fd(xendev->evtchndev)); if (ops->flags & DEVOPS_FLAG_NEED_GNTDEV) { xendev->gnttabdev = xengnttab_open(NULL, 0); -- cgit v1.2.3