From 89c26cdaf25463c891a8ce915fefa1a181b3ac64 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 27 Feb 2011 11:40:40 +0000 Subject: fix warnings and enable them for tests Cleaner code anyways. --- lib/posix_mq.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/posix_mq.rb b/lib/posix_mq.rb index a059cf8..0048c26 100644 --- a/lib/posix_mq.rb +++ b/lib/posix_mq.rb @@ -51,16 +51,16 @@ class POSIX_MQ block.arity == 1 or raise ArgumentError, "arity of notify block must be 1" r, w = IO.pipe - self.notify_exec(w, Thread.new(r, w, self) do |r, w, mq| + self.notify_exec(w, Thread.new(block) do |blk| begin begin r.read(1) or raise Errno::EINTR rescue Errno::EINTR, Errno::EAGAIN retry end - block.call(mq) + blk.call(self) ensure - mq.notify_cleanup + notify_cleanup r.close rescue nil w.close rescue nil end -- cgit v1.2.3-24-ge0c7