]> git.ipfire.org Git - thirdparty/glibc.git/commit
Assume O_DIRECTORY for opendir
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 1 Mar 2018 18:55:25 +0000 (15:55 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 3 Apr 2018 11:57:17 +0000 (08:57 -0300)
commit8e4754ed7ed60e3243ce83eee14bdcc7b88b73d1
treed79e246adf2d4d9e66ed4f9c3fc8840a7e78fa54
parent57408435ad7716715fa3a74c874eb3dc4db61861
Assume O_DIRECTORY for opendir

This patch assumes O_DIRECTORY works as defined by POSIX on opendir
implementation (aligning with other glibc code, for instance pwd).  This
allows remove both the fallback code to handle system with missing or
broken O_DIRECTORY along with the Linux specific opendir.c which just
advertise the working flag.

Checked on aarch64-linux-gnu, x86_64-linux-gnu, i686-linux-gnu,
sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu, and
powerpc64le-linux-gnu.

* sysdeps/posix/opendir.c (o_directory_works, tryopen_o_directory):
Remove definitions.
(opendir_oflags): Use O_DIRECTORY regardless.
(__opendir, __opendirat): Remove need_isdir_precheck usage.
* sysdeps/unix/sysv/linux/opendir.c: Remove file.
ChangeLog
sysdeps/posix/opendir.c
sysdeps/unix/sysv/linux/opendir.c [deleted file]