From 9854d38a3f458d0d9e80051e329c2da59e35cf75 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 3 Sep 2024 11:49:37 -0400 Subject: [PATCH] BEntry: Use AT_FDCWD instead of hardcoding -1. --- src/kits/storage/Entry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kits/storage/Entry.cpp b/src/kits/storage/Entry.cpp index 5edab8c819..b60c593b3a 100644 --- a/src/kits/storage/Entry.cpp +++ b/src/kits/storage/Entry.cpp @@ -561,7 +561,7 @@ BEntry::_SetTo(int dirFD, const char* path, bool traverse) // if no dir FD is supplied, we need to open the current directory // first if (dirFD < 0) { - dirFD = _kern_open_dir(-1, "."); + dirFD = _kern_open_dir(AT_FDCWD, "."); if (dirFD < 0) return dirFD; fdCloser.SetTo(dirFD); @@ -612,7 +612,7 @@ BEntry::_SetTo(int dirFD, const char* path, bool traverse) char* cwd = getcwd(tmpPath, B_PATH_NAME_LENGTH); if (!cwd) return B_ERROR; - dirFD = _kern_open_dir(-1, cwd); + dirFD = _kern_open_dir(AT_FDCWD, cwd); if (dirFD < 0) return dirFD; fdCloser.SetTo(dirFD); @@ -621,7 +621,7 @@ BEntry::_SetTo(int dirFD, const char* path, bool traverse) || strcmp(leafName, "..") == 0) { // We have to resolve this to get the entry name. Just open // the dir and let the next iteration deal with it. - dirFD = _kern_open_dir(-1, path); + dirFD = _kern_open_dir(AT_FDCWD, path); if (dirFD < 0) return dirFD; fdCloser.SetTo(dirFD);