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: remove O_CLOEXEC in xl_cmdimpl.c

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: remove O_CLOEXEC in xl_cmdimpl.c
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 28 Jun 2011 07:44:09 +0100
Delivery-date: Mon, 27 Jun 2011 23:44:37 -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 Yongjie Ren <yongjie.ren@xxxxxxxxx>
# Date 1308666694 -3600
# Node ID b17fbeed15488dfa789d8cff0eca6a5808479a41
# Parent  c91255b2f0a047a2fdf69633a19cdc0b10ea60a5
libxl: remove O_CLOEXEC in xl_cmdimpl.c

Some old linux kernels such as 2.6.18 don't define O_CLOEXEC, so
remove O_CLOEXEC in xl_cmdimpl.c and replace with fcntl.

Signed-off-by: Yongjie Ren <yongjie.ren@xxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r c91255b2f0a0 -r b17fbeed1548 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Mon Jun 20 13:16:14 2011 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Tue Jun 21 15:31:34 2011 +0100
@@ -199,11 +199,16 @@
     fl.l_whence = SEEK_SET;
     fl.l_start = 0;
     fl.l_len = 0;
-    fd_lock = open(lockfile, O_WRONLY|O_CREAT|O_CLOEXEC, S_IWUSR);
+    fd_lock = open(lockfile, O_WRONLY|O_CREAT, S_IWUSR);
     if (fd_lock < 0) {
         fprintf(stderr, "cannot open the lockfile %s errno=%d\n", lockfile, 
errno);
         return ERROR_FAIL;
     }
+    if (fcntl(fd_lock, F_SETFD, FD_CLOEXEC) < 0) {
+        close(fd_lock);
+        fprintf(stderr, "cannot set cloexec to lockfile %s errno=%d\n", 
lockfile, errno);
+        return ERROR_FAIL;
+    }
 get_lock:
     rc = fcntl(fd_lock, F_SETLKW, &fl);
     if (rc < 0 && errno == EINTR)

_______________________________________________
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: remove O_CLOEXEC in xl_cmdimpl.c, Xen patchbot-unstable <=