mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* io.c (maygvl_copy_stream_wait_readwrite): define if USE_SENDFILE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f8b2f4e05d
commit
ae167e1e79
2 changed files with 20 additions and 16 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Dec 29 21:20:13 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* io.c (maygvl_copy_stream_wait_readwrite): define if USE_SENDFILE
|
||||
|
||||
Wed Dec 29 20:37:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/extmk.rb: strip current directory prefix.
|
||||
|
|
32
io.c
32
io.c
|
@ -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__
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue