[PATCH v2] linux: Make fdopendir fail with O_PATH (BZ 30373)

Paul Eggert eggert@cs.ucla.edu
Thu Aug 31 20:21:30 GMT 2023


On 2023-08-10 06:54, Adhemerval Zanella via Libc-alpha wrote:
> +  /* Fail early for descriptors opened with O_PATH.  */
> +  if (__glibc_unlikely ((flags & O_PATH) == O_PATH))
> +    {
> +      __set_errno (EBADF);
> +      return NULL;
> +    }

Shouldn't this be (flags & O_PATH), not ((flags & O_PATH) == O_PATH)? 
The latter suggests more complexity than there really is.


More information about the Libc-alpha mailing list