mirror of
https://github.com/apple/swift-nio
synced 2026-11-25 04:47:49 +00:00
Fix bug in eventfd(initval: Int32, flags: Int32) (#1797)
Motivation: There is bug in `eventfd(initval: Int32, flags: Int32)` where it doesn't actually pass on the arguments to `CNIOLinux.eventfd()` disregarding the intent of the caller. Modification: Start using the arguments passed in. Result: `eventfd(initval: Int32, flags: Int32)` now works as expected.
This commit is contained in:
1 parent
ed0b013c57
commit
301e6a652f
1 file changed
+2
-2
@@ -57,9 +57,9 @@ internal enum EventFd {
|
||||
}
|
||||
|
||||
@inline(never)
|
||||
public static func eventfd(initval: Int32, flags: Int32) throws -> Int32 {
|
||||
public static func eventfd(initval: UInt32, flags: Int32) throws -> Int32 {
|
||||
return try syscall(blocking: false) {
|
||||
CNIOLinux.eventfd(0, Int32(EFD_CLOEXEC | EFD_NONBLOCK))
|
||||
CNIOLinux.eventfd(initval, flags)
|
||||
}.result
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user