summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-29 12:20:16 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-29 12:20:16 +0000
commitae167e1e79c73c589f0f410b1582795d17184205 (patch)
tree88386332f3e2814c419e4d990c8dc76acb33b93d
parentf8b2f4e05dd2beee71079f085cba0cf80f78eb34 (diff)
* 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
-rw-r--r--ChangeLog4
-rw-r--r--io.c32
2 files changed, 20 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 81a6757526..d90c39e8a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/io.c b/io.c
index 76e483a7a9..069b4fb1d2 100644
--- a/io.c
+++ b/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__
@@ -8439,6 +8423,22 @@ simple_sendfile(int out_fd, int in_fd, off_t *offset, off_t count)
#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)
{
struct stat src_stat, dst_stat;