WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libxl: Introduce libxl__fd_set_cloexec

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: Introduce libxl__fd_set_cloexec
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 01 Oct 2011 03:33:11 +0100
Delivery-date: Fri, 30 Sep 2011 19:33:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Anthony PERARD <anthony.perard@xxxxxxxxxx>
# Date 1317308762 -3600
# Node ID cf2ba5720151ac950ed9312bebef2741e9429e86
# Parent  cd60c87d34963bcbd7e5ea6450a8afae3ffbc757
libxl: Introduce libxl__fd_set_cloexec

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r cd60c87d3496 -r cf2ba5720151 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c      Thu Sep 29 15:40:34 2011 +0100
+++ b/tools/libxl/libxl_internal.c      Thu Sep 29 16:06:02 2011 +0100
@@ -242,3 +242,16 @@
 
        return ERROR_FAIL;
 }
+
+int libxl__fd_set_cloexec(int fd)
+{
+    int flags = 0;
+
+    if ((flags = fcntl(fd, F_GETFD)) == -1) {
+        flags = 0;
+    }
+    if ((flags & FD_CLOEXEC)) {
+        return 0;
+    }
+    return fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+}
diff -r cd60c87d3496 -r cf2ba5720151 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h      Thu Sep 29 15:40:34 2011 +0100
+++ b/tools/libxl/libxl_internal.h      Thu Sep 29 16:06:02 2011 +0100
@@ -384,6 +384,7 @@
 
 _hidden int libxl__file_reference_map(libxl_file_reference *f);
 _hidden int libxl__file_reference_unmap(libxl_file_reference *f);
+_hidden int libxl__fd_set_cloexec(int fd);
 
 _hidden int libxl__e820_alloc(libxl_ctx *ctx, uint32_t domid, 
libxl_domain_config *d_config);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libxl: Introduce libxl__fd_set_cloexec, Xen patchbot-unstable <=