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: Clear file object on successful mu

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: Clear file object on successful munmap()
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 18 Feb 2011 01:50:22 -0800
Delivery-date: Fri, 18 Feb 2011 01:51:30 -0800
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 Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
# Date 1297972340 0
# Node ID 5a4710640f815db6609cc41f902752f28c1d06ab
# Parent  54b0749d9f4655508b1679de4bb2841c8a1aa512
libxl: Clear file object on successful munmap()

Clear members of libxl_file_reference when file is successfully unmapped.

Signed-off-by: Jim Fehlig <jfehlig@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_internal.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff -r 54b0749d9f46 -r 5a4710640f81 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c      Thu Feb 17 19:50:44 2011 +0000
+++ b/tools/libxl/libxl_internal.c      Thu Feb 17 19:52:20 2011 +0000
@@ -233,6 +233,12 @@ int libxl__file_reference_unmap(libxl_fi
                return 0;
 
        ret = munmap(f->data, f->size);
-
-       return ret == 0 ? 0 : ERROR_FAIL;
-}
+       if (ret == 0) {
+               f->mapped = 0;
+               f->data = NULL;
+               f->size = 0;
+               return 0;
+       }
+
+       return ERROR_FAIL;
+}

_______________________________________________
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: Clear file object on successful munmap(), Xen patchbot-unstable <=