Skip to content

Commit

Permalink
Adjust styles [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Oct 7, 2021
1 parent ae5dffd commit a706c09
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions io.c
Expand Up @@ -1311,8 +1311,8 @@ io_from_fd(int fd)
return prep_io(fd, FMODE_PREP, rb_cIO, NULL);
}

static
int io_wait_for_single_fd(int fd, int events, struct timeval *timeout)
static int
io_wait_for_single_fd(int fd, int events, struct timeval *timeout)
{
VALUE scheduler = rb_fiber_scheduler_current();

Expand Down Expand Up @@ -1420,7 +1420,8 @@ rb_thread_fd_writable(int fd)
return rb_wait_for_single_fd(fd, RUBY_IO_WRITABLE, NULL);
}

VALUE rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout)
VALUE
rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout)
{
// fptr->fd can be set to -1 at any time by another thread when the GVL is
// released. Many code, e.g. `io_bufread` didn't check this correctly and
Expand Down Expand Up @@ -1460,12 +1461,14 @@ VALUE rb_io_maybe_wait(int error, VALUE io, VALUE events, VALUE timeout)
}
}

int rb_io_maybe_wait_readable(int error, VALUE io, VALUE timeout)
int
rb_io_maybe_wait_readable(int error, VALUE io, VALUE timeout)
{
return RB_NUM2INT(rb_io_maybe_wait(error, io, RB_INT2NUM(RUBY_IO_READABLE), timeout));
}

int rb_io_maybe_wait_writable(int error, VALUE io, VALUE timeout)
int
rb_io_maybe_wait_writable(int error, VALUE io, VALUE timeout)
{
return RB_NUM2INT(rb_io_maybe_wait(error, io, RB_INT2NUM(RUBY_IO_WRITABLE), timeout));
}
Expand Down

0 comments on commit a706c09

Please sign in to comment.