mirror of
https://github.com/apple/swift-system
synced 2026-11-24 04:38:14 +00:00
fix off-by-one in IORequest.openat
This commit is contained in:
1 parent
d099546787
commit
b58450413e
1 file changed
+3
-1
@@ -46,7 +46,9 @@ extension IORequest {
|
||||
request.rawValue.addr = unsafeBitCast(path, to: UInt64.self)
|
||||
request.rawValue.open_flags = UInt32(bitPattern: options.rawValue | mode.rawValue)
|
||||
request.rawValue.len = permissions?.rawValue ?? 0
|
||||
request.rawValue.file_index = UInt32(slot?.index ?? 0)
|
||||
if let fileSlot = slot {
|
||||
request.rawValue.file_index = UInt32(fileSlot.index + 1)
|
||||
}
|
||||
case .read(let file, let buffer, let offset), .write(let file, let buffer, let offset):
|
||||
if case .read = self {
|
||||
if case .registered = buffer {
|
||||
|
||||
Reference in new issue
Block a user