summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-22 02:15:35 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-22 02:15:35 +0000
commitfdfb0e53622e69624d0bd2d1297d7b19f8f2a191 (patch)
treedb8d0135469d7d095f22978c621ef69ddc1338b6
parent1619ac8ebc44318fd914dd6d81fa1ab5716bcd6c (diff)
downloadruby-fdfb0e53622e69624d0bd2d1297d7b19f8f2a191.tar.gz
ruby-fdfb0e53622e69624d0bd2d1297d7b19f8f2a191.tar.xz
ruby-fdfb0e53622e69624d0bd2d1297d7b19f8f2a191.zip
* io.c (rb_io_mode_modenum): replace O_ACCMODE with O_RDWR.
fixed: [ruby-dev:25273] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--io.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a61fe12a9..78755343f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Dec 22 11:14:55 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * io.c (rb_io_mode_modenum): replace O_ACCMODE with O_RDWR.
+ fixed: [ruby-dev:25273]
+
Wed Dec 22 08:34:32 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/dl/sym.c (rb_dlsym_initialize): extract internal pointers after
diff --git a/io.c b/io.c
index 2a231298f..0d9f07a8d 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;