From 46213a37bb2d63e02eaf2fde431e5727d198211e Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 22 Dec 2004 02:15:35 +0000 Subject: * io.c (rb_io_mode_modenum): replace O_ACCMODE with O_RDWR. fixed: [ruby-dev:25273] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index 2a231298f3..0d9f07a8d5 100644 --- a/io.c +++ b/io.c @@ -86,6 +86,10 @@ extern void Init_File _((void)); #include "util.h" +#ifndef O_ACCMODE +#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) +#endif + #if SIZEOF_OFF_T > SIZEOF_LONG && !defined(HAVE_LONG_LONG) # error off_t is bigger than long, but you have no long long... #endif @@ -2378,7 +2382,7 @@ rb_io_mode_modenum(mode) #endif break; case '+': - flags |= O_RDWR; + flags = (flags & ~O_ACCMODE) | O_RDWR; break; default: goto error; -- cgit v1.2.3