about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/opendir.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2018-03-01 15:55:25 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2018-04-03 08:57:17 -0300
commit8e4754ed7ed60e3243ce83eee14bdcc7b88b73d1 (patch)
treed79e246adf2d4d9e66ed4f9c3fc8840a7e78fa54 /sysdeps/unix/sysv/linux/opendir.c
parent57408435ad7716715fa3a74c874eb3dc4db61861 (diff)
downloadglibc-8e4754ed7ed60e3243ce83eee14bdcc7b88b73d1.tar.gz
glibc-8e4754ed7ed60e3243ce83eee14bdcc7b88b73d1.tar.xz
glibc-8e4754ed7ed60e3243ce83eee14bdcc7b88b73d1.zip
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.
Diffstat (limited to 'sysdeps/unix/sysv/linux/opendir.c')
-rw-r--r--sysdeps/unix/sysv/linux/opendir.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/sysdeps/unix/sysv/linux/opendir.c b/sysdeps/unix/sysv/linux/opendir.c
deleted file mode 100644
index 2677253620..0000000000
--- a/sysdeps/unix/sysv/linux/opendir.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright (C) 2000-2018 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#define O_DIRECTORY_WORKS	1
-
-#include <sysdeps/posix/opendir.c>