This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] bfd_cache_close_all


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]