summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-20 09:46:57 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-20 09:46:57 +0000
commit7f50895e04afe3872ef5b0a3a5820b99584083ea (patch)
tree7a058e0fa85f53f0d732a98d18b7d37c6eb6cf78 /io.c
parent7adccbb2857e05575a1fe3458da9f8b09f4fc3f4 (diff)
* 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/branches/ruby_1_8@8810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/io.c b/io.c
index e0e48ac..11bdc85 100644
--- a/io.c
+++ b/io.c
@@ -397,9 +397,12 @@ wsplit_p(OpenFile *fptr)
struct stat buf;
if (fstat(fileno(f), &buf) == 0 &&
!(S_ISREG(buf.st_mode) ||
- S_ISDIR(buf.st_mode)) &&
- (r = fcntl(fileno(f), 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;