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:
Joakim Hassila authored and GitHub committed 2021-04-09 17:47:44 +01:00
1 parent ed0b013c57
commit 301e6a652f
1 file changed
+2 -2
+2 -2
View File
@@ -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
}
}