From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH 1/2] xenmon: close qos_fd when finished with it in alloc_qos_data Date: Thu, 11 Feb 2016 11:18:28 +0000 Message-ID: <20160211111828.GD17384@citrix.com> References: <1455121585-22659-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1455121585-22659-1-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Feb 10, 2016 at 04:26:24PM +0000, Ian Campbell wrote: > Otherwise the fd is leaked. NB the mmap'd memory in the global > cpu_qos_data[n] is not affected by closing the underlying fd. > > Compile tested only. > > CID: 1055930 > > Signed-off-by: Ian Campbell Acked-by: Wei Liu > --- > tools/xenmon/xenbaked.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tools/xenmon/xenbaked.c b/tools/xenmon/xenbaked.c > index eacacb0..782f0c1 100644 > --- a/tools/xenmon/xenbaked.c > +++ b/tools/xenmon/xenbaked.c > @@ -689,6 +689,7 @@ static void alloc_qos_data(int ncpu) > cpu_qos_data[n] = new_qos; > } > free(dummy); > + close(qos_fd); > new_qos = NULL; > } > > -- > 2.1.4 >