Cygwin: re-implement fhandler_fifo::open with O_PATH

If the O_PATH flag is set, fhandler_fifo::open now simply calls
fhandler_base::open_fs.

The previous attempt to handle O_PATH in commit aa55d22c, "Cygwin:
honor the O_PATH flag when opening a FIFO", fixed a hang but otherwise
didn't do anything useful.
This commit is contained in:
Ken Brown 2020-01-23 16:31:04 +00:00 committed by Corinna Vinschen
parent d880e97ec9
commit 5fb3790422

View File

@ -453,17 +453,13 @@ fhandler_fifo::open (int flags, mode_t)
} res; } res;
if (flags & O_PATH) if (flags & O_PATH)
{ return open_fs (flags);
query_open (query_read_attributes);
nohandle (true);
}
/* Determine what we're doing with this fhandler: reading, writing, both */ /* Determine what we're doing with this fhandler: reading, writing, both */
switch (flags & O_ACCMODE) switch (flags & O_ACCMODE)
{ {
case O_RDONLY: case O_RDONLY:
if (!query_open ()) reader = true;
reader = true;
break; break;
case O_WRONLY: case O_WRONLY:
writer = true; writer = true;
@ -585,8 +581,6 @@ fhandler_fifo::open (int flags, mode_t)
} }
} }
} }
if (query_open ())
res = success;
out: out:
if (res == error_set_errno) if (res == error_set_errno)
__seterrno (); __seterrno ();