kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Fix error on ruby 2.5
@ 2017-12-15  5:34 Jeremy Evans
  2017-12-15  6:32 ` [PATCH] wait: avoid passing unnecessary args to rb_funcall Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Evans @ 2017-12-15  5:34 UTC (permalink / raw)
  To: kgio-public

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-15 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-15  5:34 Fix error on ruby 2.5 Jeremy Evans
2017-12-15  6:32 ` [PATCH] wait: avoid passing unnecessary args to rb_funcall Eric Wong
2017-12-15 15:49   ` Jeremy Evans

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kgio.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).