Skip to content

Commit

Permalink
* io.c (maygvl_copy_stream_wait_readwrite): define if USE_SENDFILE
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Dec 29, 2010
1 parent f8b2f4e commit ae167e1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Wed Dec 29 21:20:13 2010 Nobuyoshi Nakada <[email protected]>

* io.c (maygvl_copy_stream_wait_readwrite): define if USE_SENDFILE

Wed Dec 29 20:37:43 2010 Nobuyoshi Nakada <[email protected]>

* ext/extmk.rb: strip current directory prefix.
Expand Down
32 changes: 16 additions & 16 deletions io.c
Original file line number Diff line number Diff line change
Expand Up @@ -8370,22 +8370,6 @@ nogvl_copy_stream_wait_write(struct copy_stream_struct *stp)
return 0;
}

static int
maygvl_copy_stream_wait_readwrite(struct copy_stream_struct *stp)
{
int ret;
rb_fd_zero(&stp->fds);
rb_fd_set(stp->src_fd, &stp->fds);
rb_fd_set(stp->dst_fd, &stp->fds);
ret = rb_fd_select(rb_fd_max(&stp->fds), &stp->fds, NULL, NULL, NULL);
if (ret == -1) {
stp->syserr = "select";
stp->error_no = errno;
return -1;
}
return 0;
}

#ifdef HAVE_SENDFILE

# ifdef __linux__
Expand Down Expand Up @@ -8438,6 +8422,22 @@ simple_sendfile(int out_fd, int in_fd, off_t *offset, off_t count)
#endif

#ifdef USE_SENDFILE
static int
maygvl_copy_stream_wait_readwrite(struct copy_stream_struct *stp)
{
int ret;
rb_fd_zero(&stp->fds);
rb_fd_set(stp->src_fd, &stp->fds);
rb_fd_set(stp->dst_fd, &stp->fds);
ret = rb_fd_select(rb_fd_max(&stp->fds), &stp->fds, NULL, NULL, NULL);
if (ret == -1) {
stp->syserr = "select";
stp->error_no = errno;
return -1;
}
return 0;
}

static int
nogvl_copy_stream_sendfile(struct copy_stream_struct *stp)
{
Expand Down

0 comments on commit ae167e1

Please sign in to comment.