On Jan 17 21:48, Takashi Yano wrote:
> On Mon, 17 Jan 2022 13:11:46 +0100
> Corinna Vinschen wrote:
> >   if (!(res = (archetype && archetype->io_handle)
> >         || open (flags, mode & 07777)))
> > 
> > Then the archetype is one already created by a former open_with_arch
> > call and then you delete an archetype which is still in use, no?
> 
> archetype->usecount is not incremented yet here.
> archetype->usecount is incremented only when this 'if' clause
> is not true. So, isn't the following code right?
> 
>   if (!(res = (archetype && archetype->io_handle)
>         || open (flags, mode & 07777)))
>     {
>       if (archetype && archetype->usecount == 0)
>         cygheap->fdtab.delete_archetype (archetype);
>     }

Good point, yes, that sounds right to me.


Thanks,
Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to