diff --git a/ChangeLog b/ChangeLog index 59cd9dc300..321e6035da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Tue Dec 18 18:57:58 2012 KOSAKI Motohiro + + + * io.c (rb_io_wait_writable): don't use rb_thread_wait_fd() + because it is for waiting until io readable. + + * io.c (rb_io_wait_writable): always use rb_thread_fd_writable() + instaed of bare rb_wait_for_single_fd(). we shouldn't ignore + return value. + * io.c (rb_io_wait_readable): ditto. always use rb_thread_wait_fd(). + Tue Dec 18 18:55:33 2012 KOSAKI Motohiro * thread.c (rb_thread_wait_fd_rw): fix infinite loop bug. diff --git a/io.c b/io.c index 3047da4380..25680cf83e 100644 --- a/io.c +++ b/io.c @@ -1050,14 +1050,11 @@ rb_io_wait_readable(int f) #if defined(ERESTART) case ERESTART: #endif - rb_thread_wait_fd(f); - return TRUE; - case EAGAIN: #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN case EWOULDBLOCK: #endif - rb_wait_for_single_fd(f, RB_WAITFD_IN, NULL); + rb_thread_wait_fd(f); return TRUE; default: @@ -1076,14 +1073,11 @@ rb_io_wait_writable(int f) #if defined(ERESTART) case ERESTART: #endif - rb_thread_wait_fd(f); - return TRUE; - case EAGAIN: #if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN case EWOULDBLOCK: #endif - rb_wait_for_single_fd(f, RB_WAITFD_OUT, NULL); + rb_thread_fd_writable(f); return TRUE; default: