[ruby-cvs:70553] normal:r63462 (trunk): thread.c (rb_wait_for_single_fd): do not leak EINTR on timeout

normal at ruby-lang.org normal at ruby-lang.org
Fri May 18 17:01:07 JST 2018

normal	2018-05-18 17:01:07 +0900 (Fri, 18 May 2018)

  New Revision: 63462


    thread.c (rb_wait_for_single_fd): do not leak EINTR on timeout
    We must not leak EINTR to users in case a signal hits a
    ppoll/select caller right when (or just before) the timeout
    expires.  In other words, the timeout should take precedence
    over the -1 result from ppoll or select.
    We also try one more time in case of EINTR with a zero timeout,
    since technically the syscall finished before timing out if
    it returns EINTR.
    Regression appeared in r62457
    ("thread.c (update_timespec): use timespec_update_expire",
     commit e6bf0128add103730d8c96727f3ed4dab95088e4)
    and is not in any stable release of Ruby.

  Modified files:

More information about the ruby-cvs mailing list