ext/kgio/wait.c in kgio-2.1.0 vs ext/kgio/wait.c in kgio-2.1.1
- old
+ new
@@ -19,12 +19,14 @@
* encouraged to override this method in their subclasses or modules to
* work with their threading/blocking methods.
*/
static VALUE kgio_wait_readable(VALUE self)
{
+ int fd = my_fileno(self);
+
errno = EAGAIN;
- if (!rb_io_wait_readable(my_fileno(self)))
+ if (!rb_io_wait_readable(fd))
rb_sys_fail("kgio_wait_readable");
return self;
}
@@ -37,11 +39,13 @@
* encouraged to override this method in their subclasses or modules to
* work with their threading/blocking methods.
*/
static VALUE kgio_wait_writable(VALUE self)
{
+ int fd = my_fileno(self);
+
errno = EAGAIN;
- if (!rb_io_wait_writable(my_fileno(self)))
+ if (!rb_io_wait_writable(fd))
rb_sys_fail("kgio_wait_writable");
return self;
}