1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

use list_head_init instead of open-coding it

While we cannot use LIST_HEAD since r63312, we can at
least use list_head_init to make our code more readable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-05-01 08:35:19 +00:00
parent 41f4ac6aa2
commit 45255c4233
2 changed files with 2 additions and 2 deletions

2
io.c
View file

@ -4671,8 +4671,8 @@ io_close_fptr(VALUE io)
VALUE write_io;
rb_io_t *write_fptr;
struct list_head busy;
busy.n.next = busy.n.prev = &busy.n;
list_head_init(&busy);
write_io = GetWriteIO(io);
if (io != write_io) {
write_fptr = RFILE(write_io)->fptr;

View file

@ -2289,8 +2289,8 @@ void
rb_thread_fd_close(int fd)
{
struct list_head busy;
busy.n.next = busy.n.prev = &busy.n;
list_head_init(&busy);
if (rb_notify_fd_close(fd, &busy)) {
do rb_thread_schedule(); while (!list_empty(&busy));
}