From 8e4754ed7ed60e3243ce83eee14bdcc7b88b73d1 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 1 Mar 2018 15:55:25 -0300 Subject: 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. --- sysdeps/unix/sysv/linux/opendir.c | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/opendir.c (limited to 'sysdeps/unix') 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 - . */ - -#define O_DIRECTORY_WORKS 1 - -#include -- cgit 1.4.1