diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | io.c | 4 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Wed Jan 29 20:08:15 2014 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (nogvl_copy_stream_sendfile): check socket on other than + linux, as sendfile(2) on non-socket fd works only on linux. + [Feature #9427] + Wed Jan 29 18:09:48 2014 Eric Wong <e@80x24.org> * io.c (nogvl_copy_stream_sendfile): remove socket check @@ -10062,6 +10062,10 @@ nogvl_copy_stream_sendfile(struct copy_stream_struct *stp) stp->error_no = errno; return -1; } +#ifndef __linux__ + if ((dst_stat.st_mode & S_IFMT) != S_IFSOCK) + return 0; +#endif src_offset = stp->src_offset; use_pread = src_offset != (off_t)-1; |