summaryrefslogtreecommitdiffstats
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
commit820f74b94d06c256bb3ae03f801a2a19afca82a1 (patch)
tree7a058e0fa85f53f0d732a98d18b7d37c6eb6cf78
parenta30aeb294f8bee8bba703f841c3f3db23f0ad528 (diff)
downloadruby-820f74b94d06c256bb3ae03f801a2a19afca82a1.tar.gz
ruby-820f74b94d06c256bb3ae03f801a2a19afca82a1.tar.xz
ruby-820f74b94d06c256bb3ae03f801a2a19afca82a1.zip
* 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--io.c9
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 945cd4149..85904d774 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Wed Jul 20 18:40:50 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
diff --git a/io.c b/io.c
index e0e48ac3b..11bdc8591 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;