From f2d343d4163e55e054019d71c7bb91dd89d6cb49 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Thu, 8 Mar 2012 15:01:49 -0500 Subject: [PATCH] Use S_ISDIR instead of S_IFDIR to check if the fd points to a directory and take AT_SYMLINK_NO_FOLLOW out of faccessat because IEEE Std 1003.1-2008 doesn't call for it even though Linux implements it. --- src/build/libroot/fs_darwin.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/build/libroot/fs_darwin.cpp b/src/build/libroot/fs_darwin.cpp index 2cc296dfae..3c55713d49 100644 --- a/src/build/libroot/fs_darwin.cpp +++ b/src/build/libroot/fs_darwin.cpp @@ -30,7 +30,7 @@ get_path(int fd, const char* path, char** fullPath) return -1; } - if ((dirst.st_mode & S_IFDIR) == 0) { + if (!S_ISDIR(dirst.st_mode)) { // fd does not point to a directory errno = ENOTDIR; return -1; @@ -106,14 +106,6 @@ eaccess(const char* path, int accessMode) int faccessat(int fd, const char* path, int accessMode, int flag) { - if ((flag & AT_SYMLINK_NOFOLLOW) != 0) { - // do not dereference, instead return information about the link - // itself - // CURRENTLY UNSUPPORTED - errno = ENOTSUP; - return -1; - } - if (fd == AT_FDCWD || path != NULL && path[0] == '/') { // call access() ignoring fd return (flag & AT_EACCESS) != 0 ? eaccess(path, accessMode)