From f96607840c3fde676e670b7303abba9fb8084a4a Mon Sep 17 00:00:00 2001 From: 3405691582 Date: Mon, 16 Dec 2019 18:42:07 -0500 Subject: [PATCH] [CF] DT_WHT is unavailable on OpenBSD. Here we duplicate this extended conditional to not reference DT_WHT, which is not available on OpenBSD. It is probably harmless to actually remove DT_WHT entirely here unconditionally, but would require grokking more context for a simple buildfix. It also seems more readable to duplicate the entire line in the ifdef despite being able to squish the ifdef in the clause. --- CoreFoundation/Base.subproj/CFFileUtilities.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CoreFoundation/Base.subproj/CFFileUtilities.c b/CoreFoundation/Base.subproj/CFFileUtilities.c index e003d44e0f..74d13696f6 100644 --- a/CoreFoundation/Base.subproj/CFFileUtilities.c +++ b/CoreFoundation/Base.subproj/CFFileUtilities.c @@ -439,7 +439,11 @@ CF_PRIVATE CFMutableArrayRef _CFCreateContentsOfDirectory(CFAllocatorRef alloc, dirURL = CFURLCreateFromFileSystemRepresentation(alloc, (uint8_t *)dirPath, pathLength, true); releaseBase = true; } +#if !defined(__OpenBSD__) if (dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN || dp->d_type == DT_LNK || dp->d_type == DT_WHT) { +#else + if (dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN || dp->d_type == DT_LNK) { +#endif Boolean isDir = (dp->d_type == DT_DIR); if (!isDir) { // Ugh; must stat.