diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-04-10 06:15:43 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-04-10 06:17:47 +0000 |
commit | 0af99fe16b3052b8235f62c50136b2dc25fc6cd2 (patch) | |
tree | f1fd0acc53546768fcd0e17c72a0301fd7ea6af4 | |
parent | fa661e5e53f2375c49073086dbdd166bb361ad83 (diff) | |
download | sleepy_penguin-0af99fe16b3052b8235f62c50136b2dc25fc6cd2.tar.gz |
Probably not an issue under Linux
-rw-r--r-- | ext/sleepy_penguin/epoll.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/sleepy_penguin/epoll.c b/ext/sleepy_penguin/epoll.c index 9a37ef8..f71b658 100644 --- a/ext/sleepy_penguin/epoll.c +++ b/ext/sleepy_penguin/epoll.c @@ -520,10 +520,12 @@ static VALUE epclose(VALUE self) } else if (ep->fd == -1) { rb_raise(rb_eIOError, "closed"); } else { - int e = close(ep->fd); + int err; + int fd = ep->fd; ep->fd = -1; - if (e == -1) + err = close(fd); + if (err == -1) rb_sys_fail("close"); } } else { |