diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-20 09:46:57 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-20 09:46:57 +0000 |
commit | 2b2256217eb359a055c394a0bebab94d2e7ac413 (patch) | |
tree | b2eff77929d23944da8b28543ebfaf5c9fe61c08 /io.c | |
parent | 74e1cc9e55eae39b2adcbdec1d4bff0b70bf0c88 (diff) | |
download | ruby-2b2256217eb359a055c394a0bebab94d2e7ac413.tar.gz |
* 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
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; |