public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH v2 2/3] Cygwin: path_conv::check: handle error from fhandler_process::exists
@ 2020-09-08 19:02 Ken Brown
  2020-09-08 19:05 ` Ken Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Brown @ 2020-09-08 19:02 UTC (permalink / raw)
  To: cygwin-patches

fhandler_process::exists is called when we are checking a path
starting with "/proc/<pid>/fd".  If it returns virt_none and sets an
errno, there is no need for further checking.  Just set 'error' and
return.
---
 winsup/cygwin/path.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 95faf8ca7..1d0c38a20 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -809,6 +809,15 @@ path_conv::check (const char *src, unsigned opt,
 			  delete fh;
 			  goto retry_fs_via_processfd;
 			}
+		      else if (file_type == virt_none && dev == FH_PROCESSFD)
+			{
+			  error = get_errno ();
+			  if (error)
+			    {
+			      delete fh;
+			      return;
+			    }
+			}
 		      delete fh;
 		    }
 		  switch (file_type)
-- 
2.28.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 2/3] Cygwin: path_conv::check: handle error from fhandler_process::exists
  2020-09-08 19:02 [PATCH v2 2/3] Cygwin: path_conv::check: handle error from fhandler_process::exists Ken Brown
@ 2020-09-08 19:05 ` Ken Brown
  2020-09-08 19:15   ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Brown @ 2020-09-08 19:05 UTC (permalink / raw)
  To: cygwin-patches

On 9/8/2020 3:02 PM, Ken Brown via Cygwin-patches wrote:
> fhandler_process::exists is called when we are checking a path
> starting with "/proc/<pid>/fd".  If it returns virt_none and sets an
> errno, there is no need for further checking.  Just set 'error' and
> return.
> ---
>   winsup/cygwin/path.cc | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
> index 95faf8ca7..1d0c38a20 100644
> --- a/winsup/cygwin/path.cc
> +++ b/winsup/cygwin/path.cc
> @@ -809,6 +809,15 @@ path_conv::check (const char *src, unsigned opt,
>   			  delete fh;
>   			  goto retry_fs_via_processfd;
>   			}
> +		      else if (file_type == virt_none && dev == FH_PROCESSFD)
> +			{
> +			  error = get_errno ();
> +			  if (error)
> +			    {
> +			      delete fh;
> +			      return;
> +			    }
> +			}
>   		      delete fh;
>   		    }
>   		  switch (file_type)
> 

The subject should say "2/2", not "2/3".  I have a local third patch documenting 
the bug fix, which I didn't bother to send.

Ken

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 2/3] Cygwin: path_conv::check: handle error from fhandler_process::exists
  2020-09-08 19:05 ` Ken Brown
@ 2020-09-08 19:15   ` Corinna Vinschen
  0 siblings, 0 replies; 3+ messages in thread
From: Corinna Vinschen @ 2020-09-08 19:15 UTC (permalink / raw)
  To: cygwin-patches

On Sep  8 15:05, Ken Brown via Cygwin-patches wrote:
> On 9/8/2020 3:02 PM, Ken Brown via Cygwin-patches wrote:
> > fhandler_process::exists is called when we are checking a path
> > starting with "/proc/<pid>/fd".  If it returns virt_none and sets an
> > errno, there is no need for further checking.  Just set 'error' and
> > return.
> > ---
> >   winsup/cygwin/path.cc | 9 +++++++++
> >   1 file changed, 9 insertions(+)
> > 
> > diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
> > index 95faf8ca7..1d0c38a20 100644
> > --- a/winsup/cygwin/path.cc
> > +++ b/winsup/cygwin/path.cc
> > @@ -809,6 +809,15 @@ path_conv::check (const char *src, unsigned opt,
> >   			  delete fh;
> >   			  goto retry_fs_via_processfd;
> >   			}
> > +		      else if (file_type == virt_none && dev == FH_PROCESSFD)
> > +			{
> > +			  error = get_errno ();
> > +			  if (error)
> > +			    {
> > +			      delete fh;
> > +			      return;
> > +			    }
> > +			}
> >   		      delete fh;
> >   		    }
> >   		  switch (file_type)
> > 
> 
> The subject should say "2/2", not "2/3".  I have a local third patch
> documenting the bug fix, which I didn't bother to send.

ACk to both patches, 2 and 3 ;)


Corinna

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-08 19:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 19:02 [PATCH v2 2/3] Cygwin: path_conv::check: handle error from fhandler_process::exists Ken Brown
2020-09-08 19:05 ` Ken Brown
2020-09-08 19:15   ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).