diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-11 11:51:39 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-11 11:51:39 +0000 |
| commit | 1433d2dd96df6b4a45da490dbe99e5fea810d905 (patch) | |
| tree | 9ec9aad1d90ceb6c1b5466f490f28380732d3c0c /thread.c | |
| parent | 0f5ca06a4aeb42c19348c66cc8f0ef59b3670272 (diff) | |
| download | ruby-1433d2dd96df6b4a45da490dbe99e5fea810d905.tar.gz ruby-1433d2dd96df6b4a45da490dbe99e5fea810d905.tar.xz ruby-1433d2dd96df6b4a45da490dbe99e5fea810d905.zip | |
* io.c (rb_io_wait_readable, rb_io_wait_writable): check if the file
descriptor is closed.
* thread.c (rb_thread_wait_fd_rw): ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
| -rw-r--r-- | thread.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -2018,6 +2018,9 @@ rb_thread_wait_fd_rw(int fd, int read) int result = 0; thread_debug("rb_thread_wait_fd_rw(%d, %s)\n", fd, read ? "read" : "write"); + if (fd < 0) { + rb_raise(rb_eIOError, "closed stream"); + } while (result <= 0) { rb_fdset_t set; rb_fd_init(&set); |
