Skip to content

Commit bea8dbb

Browse files
Use POSIXErrorCode instead of direct errno E constants from libc
wasi-libc's E constants cannot be imported directly by ClangImporter, so we should use `POSIXErrorCode` from Swift instead.
1 parent b6ca869 commit bea8dbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/FoundationEssentials/Error/CocoaError+FilePath.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ extension CocoaError {
9494
var userInfo = userInfo
9595

9696
// (130280235) POSIXError.Code does not have a case for EOPNOTSUPP
97-
if errno != EOPNOTSUPP {
97+
if errno != POSIXErrorCode.EOPNOTSUPP.rawValue {
9898
guard let code = POSIXError.Code(rawValue: errno) else {
9999
fatalError("Invalid posix errno \(errno)")
100100
}

0 commit comments

Comments
 (0)