Jim Fehlig
2011-Feb-17 18:28 UTC
[Xen-devel] [PATCH] libxl: Clear file object on successful munmap()
# HG changeset patch # User Jim Fehlig <jfehlig@novell.com> # 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@novell.com> 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@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Jackson
2011-Feb-17 19:52 UTC
Re: [Xen-devel] [PATCH] libxl: Clear file object on successful munmap()
Jim Fehlig writes ("[Xen-devel] [PATCH] libxl: Clear file object on successful munmap()"):> # HG changeset patch > # User Jim Fehlig <jfehlig@novell.com> > # 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.Applied, thanks. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel