[PATCH] Cygwin: introduce close_range

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jan 15 12:08:47 GMT 2024


On Jan 15 13:07, Corinna Vinschen wrote:
> Sorry Christian, but..
> 
> I was just going to push this patch when I realized that we now have
> two lines of debug output per affected file descriptor:
> 
> On Jan 15 12:19, Christian Franke wrote:
> > +  for (unsigned int i = firstfd; i < size; i++)
> > +    {
> > +      cygheap_fdget cfd ((int) i, false, false);
> > +      if (cfd < 0)
> > +	continue;
> > +
> > +      if (flags & CLOSE_RANGE_CLOEXEC)
> > +	{
> > +	  syscall_printf ("set FD_CLOEXEC on fd %u", i);
> > +	  cfd->fcntl (F_SETFD, FD_CLOEXEC);
> 
> fhandler::set_close_on_exec() already prints this:
> 
>   debug_printf ("set close_on_exec for %s to %d", get_name (), val);
> 
> > +	}
> > +      else
> > +	{
> > +	  syscall_printf ("closing fd %u", i);
> > +	  cfd->close_with_arch ();
> 
> fhandler::close() already prints this:
> 
>   syscall_printf ("closing '%s' handle %p", get_name (), get_handle ());
> 
> Shan't we drop the syscall calls from close_range()?
                     ^^^^^^^
                   syscall_printf


More information about the Cygwin-patches mailing list