From 76834dc7ced6ec56523d51d4abff75674c3199ad Mon Sep 17 00:00:00 2001 From: Nikolay Igotti Date: Thu, 18 Jan 2018 15:41:15 +0300 Subject: [PATCH] Fix predicate check in sample. --- samples/globalState/src/main/kotlin/Global.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/globalState/src/main/kotlin/Global.kt b/samples/globalState/src/main/kotlin/Global.kt index bd2e4547266..64fce7ac530 100644 --- a/samples/globalState/src/main/kotlin/Global.kt +++ b/samples/globalState/src/main/kotlin/Global.kt @@ -18,7 +18,7 @@ import global.* import kotlinx.cinterop.* import platform.posix.* -fun Int.ensureUnixCallResult(op: String, predicate: (Int) -> Boolean = { x -> x >= 0} ): Int { +fun Int.ensureUnixCallResult(op: String, predicate: (Int) -> Boolean = { x -> x == 0} ): Int { if (!predicate(this)) { throw Error("$op: ${strerror(posix_errno())!!.toKString()}") }