From 72bb2c7ad8c1fb4b859d604b0f964cc0813bf912 Mon Sep 17 00:00:00 2001 From: Interfere Date: Fri, 11 May 2018 21:18:31 +0300 Subject: [PATCH] Fix stopAndWait() hang when -Owholemodule --- Sources/SelectorEventLoop.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/SelectorEventLoop.swift b/Sources/SelectorEventLoop.swift index 056181c..bb7ddbb 100644 --- a/Sources/SelectorEventLoop.swift +++ b/Sources/SelectorEventLoop.swift @@ -177,8 +177,9 @@ public final class SelectorEventLoop: EventLoop { // interrupt the selector private func interruptSelector() { let byte = [UInt8](repeating: 0, count: 1) + let rc = write(pipeSender, byte, byte.count) assert( - write(pipeSender, byte, byte.count) >= 0, + rc >= 0, "Failed to interrupt selector, errno=\(errno), message=\(lastErrorDescription())" ) }