From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS40173 67.222.241.0/24 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from smtp-out-2.mxes.net (smtp-out-2.mxes.net [67.222.241.249]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A1F9E1F404 for ; Fri, 15 Dec 2017 05:34:38 +0000 (UTC) Received: from battleground.jeremyevans.local (c-73-90-99-19.hsd1.ca.comcast.net [73.90.99.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 47C5627587 for ; Fri, 15 Dec 2017 00:34:36 -0500 (EST) Received: from jeremyevans.local (speedstar.jeremyevans.local [10.187.8.2]) by battleground.jeremyevans.local (OpenSMTPD) with ESMTPS id 2475a2cb (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO) for ; Thu, 14 Dec 2017 21:34:35 -0800 (PST) Date: Thu, 14 Dec 2017 21:34:34 -0800 From: Jeremy Evans To: kgio-public@bogomips.org Subject: Fix error on ruby 2.5 Message-ID: <20171215053434.GT7579@jeremyevans.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) List-Id: Example code: require 'socket' require 'kgio' addr = Socket.pack_sockaddr_in(80, 'www') socket = Kgio::Socket.connect(addr) buf = String.new(:capacity=>16384); nil socket.kgio_read!(16384, buf) Result on ruby 2.5: TypeError: can't convert FalseClass into time interval Cause: Misuse of rb_funcall. Not sure why ruby 2.5 is pickier than previous versions. Noticed when testing unicorn with ruby 2.5. Fix: --- ext/kgio/wait.c.orig +++ ext/kgio/wait.c @@ -92,12 +92,12 @@ static VALUE kgio_wait_writable(int argc, VALUE *argv, VALUE kgio_call_wait_writable(VALUE io) { - return rb_funcall(io, id_wait_wr, 0, 0); + return rb_funcall(io, id_wait_wr, 0); } VALUE kgio_call_wait_readable(VALUE io) { - return rb_funcall(io, id_wait_rd, 0, 0); + return rb_funcall(io, id_wait_rd, 0); } void init_kgio_wait(void)