Skip to content

Commit f966078

Browse files
committed
[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.
1 parent 07f4c1a commit f966078

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CoreFoundation/Base.subproj/CFFileUtilities.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,11 @@ CF_PRIVATE CFMutableArrayRef _CFCreateContentsOfDirectory(CFAllocatorRef alloc,
439439
dirURL = CFURLCreateFromFileSystemRepresentation(alloc, (uint8_t *)dirPath, pathLength, true);
440440
releaseBase = true;
441441
}
442+
#if !defined(__OpenBSD__)
442443
if (dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN || dp->d_type == DT_LNK || dp->d_type == DT_WHT) {
444+
#else
445+
if (dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN || dp->d_type == DT_LNK) {
446+
#endif
443447
Boolean isDir = (dp->d_type == DT_DIR);
444448
if (!isDir) {
445449
// Ugh; must stat.

0 commit comments

Comments
 (0)