[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] libxl: Clear file object on successful munmap()



# HG changeset patch
# User Jim Fehlig <jfehlig@xxxxxxxxxx>
# Date 1297967281 25200
# Node ID a7061a9d0d92de5172afb42cbfdf2cd2d46d0d0e
# Parent  c0a46434347b265fc8c45e9be3adc41b43f4f682
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>

diff -r c0a46434347b -r a7061a9d0d92 tools/libxl/libxl_internal.c
--- a/tools/libxl/libxl_internal.c      Wed Feb 16 18:23:48 2011 +0000
+++ b/tools/libxl/libxl_internal.c      Thu Feb 17 11:28:01 2011 -0700
@@ -233,6 +233,12 @@
                return 0;
 
        ret = munmap(f->data, f->size);
+       if (ret == 0) {
+               f->mapped = 0;
+               f->data = NULL;
+               f->size = 0;
+               return 0;
+       }
 
-       return ret == 0 ? 0 : ERROR_FAIL;
+       return ERROR_FAIL;
 }

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.