ruby-changes:19386
From: kosaki <ko1@a...>
Date: Wed, 4 May 2011 12:47:41 +0900 (JST)
Subject: [ruby-changes:19386] Ruby:r31426 (trunk): * thread.c (rb_wait_for_single_fd): Added POLLNVAL check.
kosaki 2011-05-04 12:47:33 +0900 (Wed, 04 May 2011) New Revision: 31426 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31426 Log: * thread.c (rb_wait_for_single_fd): Added POLLNVAL check. based on a patch from Eric Wong at [ruby-core:35991]. Modified files: trunk/ChangeLog trunk/thread.c Index: ChangeLog =================================================================== --- ChangeLog (revision 31425) +++ ChangeLog (revision 31426) @@ -1,3 +1,8 @@ +Wed May 4 12:46:25 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * thread.c (rb_wait_for_single_fd): Added POLLNVAL check. + based on a patch from Eric Wong at [ruby-core:35991]. + Wed May 4 11:51:01 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * io.c (rb_f_select): remove useless ifdef. Index: thread.c =================================================================== --- thread.c (revision 31425) +++ thread.c (revision 31426) @@ -2737,7 +2737,10 @@ }, ubf_select, GET_THREAD()); if (result > 0) { - /* remain compatible with select(2)-based implementation */ + if (fds.revents & POLLNVAL) { + errno = EBADF; + return -1; + } result = (int)(fds.revents & fds.events); return result == 0 ? events : result; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/