Skip to content

Commit

Permalink
ext/socket: fix a mistake in bc2f90c. modified to close IO's variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Dec 6, 2011
1 parent fff9e91 commit e53efce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ext/socket/socket.c
Expand Up @@ -3073,13 +3073,13 @@ socket_sendfile(VALUE self, SEL sel, VALUE file, VALUE offset, VALUE len)

if (sendfile(source->fd, socket->fd, to_offset, &to_write, NULL, 0) == -1) {
if (needs_to_close) {
rb_io_close(file);
rb_io_close(io);
}
rb_sys_fail("sendfile(2) failed.");
}

if (needs_to_close) {
rb_io_close(file);
rb_io_close(io);
}

return OFFT2NUM(to_write);
Expand Down

0 comments on commit e53efce

Please sign in to comment.