diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-01-30 15:52:14 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-01 20:05:20 +0100 |
commit | d011ab5708c2be4e2cc7eb8851c9e2c614410bd3 (patch) | |
tree | 8c1aa7b73463094193775917e2435391e7f2a966 /hurd/hurdlookup.c | |
parent | 98f9435f336cbee5d57a1a16373331ca1bc648db (diff) | |
download | glibc-d011ab5708c2be4e2cc7eb8851c9e2c614410bd3.tar.gz glibc-d011ab5708c2be4e2cc7eb8851c9e2c614410bd3.tar.xz glibc-d011ab5708c2be4e2cc7eb8851c9e2c614410bd3.zip |
hurd: Consolidate file_name_lookup implementation
Instead of __file_name_lookup_at delegating to __file_name_lookup in simple cases, make __file_name_lookup_at deal with both cases, and have __file_name_lookup simply wrap __file_name_lookup_at. This factorizes handling the empy name case. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230130125216.6254-2-bugaevc@gmail.com>
Diffstat (limited to 'hurd/hurdlookup.c')
-rw-r--r-- | hurd/hurdlookup.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/hurd/hurdlookup.c b/hurd/hurdlookup.c index 49eac4439e..3cfe444f5e 100644 --- a/hurd/hurdlookup.c +++ b/hurd/hurdlookup.c @@ -16,6 +16,7 @@ <https://www.gnu.org/licenses/>. */ #include <hurd.h> +#include <hurd/fd.h> #include <hurd/lookup.h> #include <string.h> #include <fcntl.h> @@ -220,14 +221,7 @@ weak_alias (__hurd_directory_name_split, hurd_directory_name_split) file_t __file_name_lookup (const char *file_name, int flags, mode_t mode) { - error_t err; - file_t result; - - err = __hurd_file_name_lookup (&_hurd_ports_use, &__getdport, 0, - file_name, flags, mode & ~_hurd_umask, - &result); - - return err ? (__hurd_fail (err), MACH_PORT_NULL) : result; + return __file_name_lookup_at (AT_FDCWD, 0, file_name, flags, mode); } weak_alias (__file_name_lookup, file_name_lookup) |