From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10496 invoked by alias); 17 Jun 2004 02:22:47 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10387 invoked from network); 17 Jun 2004 02:22:44 -0000 Received: from unknown (HELO modra.org) (144.136.182.188) by sourceware.org with SMTP; 17 Jun 2004 02:22:44 -0000 Received: by bubble.modra.org (Postfix, from userid 500) id 1BA0AE393A; Thu, 17 Jun 2004 11:52:41 +0930 (CST) Date: Thu, 17 Jun 2004 02:22:00 -0000 From: Alan Modra To: Jerome Guitton Cc: binutils@sources.redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] bfd_cache_close_all Message-ID: <20040617022241.GF3596@bubble.modra.org> Mail-Followup-To: Jerome Guitton , binutils@sources.redhat.com, gdb-patches@sources.redhat.com References: <20040616171748.GA8782@act-europe.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040616171748.GA8782@act-europe.fr> User-Agent: Mutt/1.4i X-SW-Source: 2004-06/txt/msg00395.txt.bz2 On Wed, Jun 16, 2004 at 07:17:48PM +0200, Jerome Guitton wrote: > The idea would be to have a function bfd_cache_close_all that would > clear the file descriptor cache. > > OK to apply? > + if (!bfd_last_cache) > + return TRUE; > + > + for (kill = bfd_last_cache->lru_prev; > + open_files; > + kill = kill->lru_prev) > + { > + ret = ret && bfd_cache_close (kill); > + } No need to close oldest first. OK with the following change to simplify the code. while (bfd_last_cache != NULL) ret &= bfd_cache_close (bfd_last_cache); -- Alan Modra IBM OzLabs - Linux Technology Centre