1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* io.c (wsplit_p): patch for the environment where

fcntl(F_GETFL, O_NONBLOCK) is not supported. in that case,
  set FMODE_WSPLIT without fcntl check. [ruby-dev:26566]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-07-20 09:46:57 +00:00
parent 74e1cc9e55
commit 2b2256217e
2 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,9 @@
Wed Jul 20 18:33:15 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* io.c (wsplit_p): patch for the environment where
fcntl(F_GETFL, O_NONBLOCK) is not supported. in that case,
set FMODE_WSPLIT without fcntl check. [ruby-dev:26566]
Wed Jul 20 18:07:11 2005 Tanaka Akira <akr@m17n.org>
* io.c (rb_io_ctl): update FMODE_WSPLIT_INITIALIZED and FMODE_WSPLIT

9
io.c
View file

@ -380,9 +380,12 @@ wsplit_p(OpenFile *fptr)
struct stat buf;
if (fstat(fptr->fd, &buf) == 0 &&
!(S_ISREG(buf.st_mode) ||
S_ISDIR(buf.st_mode)) &&
(r = fcntl(fptr->fd, F_GETFL)) != -1 &&
!(r & O_NONBLOCK)) {
S_ISDIR(buf.st_mode))
#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
&& (r = fcntl(fileno(f), F_GETFL)) != -1 &&
!(r & O_NONBLOCK)
#endif
) {
fptr->mode |= FMODE_WSPLIT;
}
fptr->mode |= FMODE_WSPLIT_INITIALIZED;